git-svn: reduce stat() calls for a backwards compatibility check
Also, this fixes a bug where in an odd case a remote named "config" could get renamed to ".metadata". Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
b3bf96d483
commit
38570a47fc
@ -1457,7 +1457,7 @@ sub tmp_config {
|
|||||||
my (@args) = @_;
|
my (@args) = @_;
|
||||||
my $old_def_config = "$ENV{GIT_DIR}/svn/config";
|
my $old_def_config = "$ENV{GIT_DIR}/svn/config";
|
||||||
my $config = "$ENV{GIT_DIR}/svn/.metadata";
|
my $config = "$ENV{GIT_DIR}/svn/.metadata";
|
||||||
if (-e $old_def_config && ! -e $config) {
|
if (! -f $config && -f $old_def_config) {
|
||||||
rename $old_def_config, $config or
|
rename $old_def_config, $config or
|
||||||
die "Failed rename $old_def_config => $config: $!\n";
|
die "Failed rename $old_def_config => $config: $!\n";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user