Skip to content

Commit

Permalink
fast-import: close pack before unlinking it
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed Dec 16, 2008
1 parent a833502 commit 87c8a56
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fast-import.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit 87c8a56

Please sign in to comment.