git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/3] git-svn: reduce stat() calls for a backwards compatibility check

From
EWEric Wong <normalperson@yhbt.net>
Date
Jun 13, 2007, 09:37 UTC
Message-ID
<11817274293330-git-send-email-normalperson@yhbt.net>
In-Reply-To
<11817274254011-git-send-email-normalperson@yhbt.net>

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>
---
 git-svn.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 58f7dd0..0ae8d70 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";
 	}
-- 
1.5.2.1.243.gbe00
Previous: Eric Wong
Message 4 of 4 in “git-svn: several house-keeping fixes”
  1. 0/3 git-svn: several house-keeping fixesEric Wong, Jun 13, 2007
  2. 1/3 git-svn: cleanup: factor out longest_common_path() functionEric Wong, Jun 13, 2007
  3. 2/3 git-svn: test for creating new directories over svn://Eric Wong, Jun 13, 2007
  4. 3/3 git-svn: reduce stat() calls for a backwards compatibility checkEric Wong, Jun 13, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.