From: Eric Wong Date: Wed, 13 Jun 2007 09:37:05 +0000 (-0700) Subject: git-svn: reduce stat() calls for a backwards compatibility check X-Git-Tag: v1.5.3-rc0~95 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=38570a47fcd9d7631c03673249f587697fa85677;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/git-svn.perl b/git-svn.perl index 58f7dd095..0ae8d70de 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -1457,7 +1457,7 @@ sub tmp_config { my (@args) = @_; my $old_def_config = "$ENV{GIT_DIR}/svn/config"; 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 die "Failed rename $old_def_config => $config: $!\n"; }