summaryrefslogtreecommitdiff
path: root/fast-import.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2008-12-15 21:11:40 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-12-16 07:04:48 (GMT)
commit87c8a56e4f71cc7e22c16caa4adc2ae17f6aa93d (patch)
tree0b58d8421a6f83c88b469b761abe794a4e1d148d /fast-import.c
parenta8335024c294db470e16e9df3aaa346bfcfbeacb (diff)
downloadgit-87c8a56e4f71cc7e22c16caa4adc2ae17f6aa93d.zip
git-87c8a56e4f71cc7e22c16caa4adc2ae17f6aa93d.tar.gz
git-87c8a56e4f71cc7e22c16caa4adc2ae17f6aa93d.tar.bz2
fast-import: close pack before unlinking it
This is sort of a companion patch to 4723ee9(Close files opened by lock_file() before unlinking.): on Windows, you cannot delete what is still open. This makes test 9300-fast-import pass on Windows for me; quite a few fast-imports leave temporary packs until the test "blank lines not necessary after other commands" actually tests for the number of files in .git/objects/pack/, which has a few temporary packs now. I guess that 8b4eb6b(Do not perform cross-directory renames when creating packs) was "responsible" for the breakage. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fast-import.c')
-rw-r--r--fast-import.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fast-import.c b/fast-import.c
index 5473cd4..13b3614 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -982,8 +982,10 @@ static void end_packfile(void)
pack_id++;
}
- else
+ else {
+ close(old_p->pack_fd);
unlink(old_p->pack_name);
+ }
free(old_p);
/* We can't carry a delta across packfiles. */