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

[PATCH] fast-import: close pack before unlinking it

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Dec 15, 2008, 21:11 UTC
Message-ID
<alpine.DEB.1.00.0812152210480.30769@pacific.mpi-cbg.de>

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>
---
 fast-import.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/fast-import.c b/fast-import.c
index 3276d5d..201d4ff 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -983,8 +983,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. */
-- 
1.6.1.rc3.368.g63acc
Message 1 of 1 in “fast-import: close pack before unlinking it”
  1. fast-import: close pack before unlinking itJohannes Schindelin, Dec 15, 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.