{"thread":{"id":"11451","subject":"[PATCH] git-svn: unlink index files that were globbed, too","startedAt":"2008-01-02T18:10:03Z","lastAt":"2008-01-02T18:10:03Z","messageCount":1,"participants":["Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"64341","messageId":"1199297404-20030-1-git-send-email-normalperson@yhbt.net","threadId":"11451","inReplyTo":null,"subject":"[PATCH] git-svn: unlink index files that were globbed, too","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2008-01-02T18:10:03Z","receivedAt":"2008-01-02T18:10:03Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"commit 3157dd9e89a71e80673d0bc21b5c0630f3b1fe68 introduced\nunlinking index files after fetching.  However, this missed\nindices for refs that were created by globbing branches and\ntags.  This will track all refs we ever touch during a fetch and\nunlink them at exit time.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n git-svn.perl |    9 ++++++---\n 1 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 9b1113a..2c97b05 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -1283,8 +1283,11 @@ BEGIN {\n \t}\n }\n \n-my %LOCKFILES;\n-END { unlink keys %LOCKFILES if %LOCKFILES }\n+my (%LOCKFILES, %INDEX_FILES);\n+END {\n+\tunlink keys %LOCKFILES if %LOCKFILES;\n+\tunlink keys %INDEX_FILES if %INDEX_FILES;\n+}\n \n sub resolve_local_globs {\n \tmy ($url, $fetch, $glob_spec) = @_;\n@@ -1376,7 +1379,6 @@ sub fetch_all {\n \n \t($base, $head) = parse_revision_argument($base, $head);\n \t$ra->gs_fetch_loop_common($base, $head, \\@gs, \\@globs);\n-\tunlink $_->{index} foreach @gs;\n }\n \n sub read_all_remotes {\n@@ -3945,6 +3947,7 @@ sub gs_fetch_loop_common {\n \t\t\t\tif ($log_entry) {\n \t\t\t\t\t$gs->do_git_commit($log_entry);\n \t\t\t\t}\n+\t\t\t\t$INDEX_FILES{$gs->{index}} = 1;\n \t\t\t}\n \t\t\tforeach my $g (@$globs) {\n \t\t\t\tmy $k = \"svn-remote.$g->{remote}.\" .\n-- \n1.5.4.rc2.7.g6277-dirty\n"}]}