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

[PATCH] git-svn: unlink index files that were globbed, too

From
EWEric Wong <normalperson@yhbt.net>
Date
Jan 2, 2008, 18:10 UTC
Message-ID
<1199297404-20030-1-git-send-email-normalperson@yhbt.net>

commit 3157dd9e89a71e80673d0bc21b5c0630f3b1fe68 introduced unlinking index files after fetching. However, this missed indices for refs that were created by globbing branches and tags. This will track all refs we ever touch during a fetch and unlink them at exit time.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 git-svn.perl |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 9b1113a..2c97b05 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1283,8 +1283,11 @@ BEGIN {
 	}
 }
 
-my %LOCKFILES;
-END { unlink keys %LOCKFILES if %LOCKFILES }
+my (%LOCKFILES, %INDEX_FILES);
+END {
+	unlink keys %LOCKFILES if %LOCKFILES;
+	unlink keys %INDEX_FILES if %INDEX_FILES;
+}
 
 sub resolve_local_globs {
 	my ($url, $fetch, $glob_spec) = @_;
@@ -1376,7 +1379,6 @@ sub fetch_all {
 
 	($base, $head) = parse_revision_argument($base, $head);
 	$ra->gs_fetch_loop_common($base, $head, \@gs, \@globs);
-	unlink $_->{index} foreach @gs;
 }
 
 sub read_all_remotes {
@@ -3945,6 +3947,7 @@ sub gs_fetch_loop_common {
 				if ($log_entry) {
 					$gs->do_git_commit($log_entry);
 				}
+				$INDEX_FILES{$gs->{index}} = 1;
 			}
 			foreach my $g (@$globs) {
 				my $k = "svn-remote.$g->{remote}." .
-- 
1.5.4.rc2.7.g6277-dirty
Message 1 of 1 in “git-svn: unlink index files that were globbed, too”
  1. git-svn: unlink index files that were globbed, tooEric Wong, Jan 2, 2008

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.