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

[PATCH 2/3] fast-import: fix corner case for checkpoint

From
Dmitry Ivankov <divanorama@gmail.com>
Date
Sep 18, 2011, 19:01 UTC
Message-ID
<1316372508-7173-3-git-send-email-divanorama@gmail.com>
In-Reply-To
<1316372508-7173-1-git-send-email-divanorama@gmail.com>

checkpoint command makes fast-import finish current pack and write out branches/tags and marks. In case no new objects are added in current pack fast-import falls back to no-op. While it is possible that refs or marks need to be updated (to point to old objects).

Make fast-import always dump them on checkpoint. But as before do not cycle_packfile if there are no objects to write.

Signed-off-by: Dmitry Ivankov <divanorama@gmail.com>
---
 fast-import.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/fast-import.c b/fast-import.c
index 907cb05..014a807 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -3025,12 +3025,11 @@ static void parse_ls(struct branch *b)
 static void checkpoint(void)
 {
 	checkpoint_requested = 0;
-	if (object_count) {
+	if (object_count)
 		cycle_packfile();
-		dump_branches();
-		dump_tags();
-		dump_marks();
-	}
+	dump_branches();
+	dump_tags();
+	dump_marks();
 }
 
 static void parse_checkpoint(void)
-- 
1.7.3.4
Previous: Jonathan NiederNext: Jonathan Nieder
Message 4 of 9 in “fast-import: fix pack_id corner cases”
  1. 0/3 fast-import: fix pack_id corner casesDmitry Ivankov, Sep 18, 2011
  2. 1/3 fast-import: die if we produce too many (MAX_PACK_ID) packsDmitry Ivankov, Sep 18, 2011
  3. Jonathan NiederSep 18, 2011
  4. 2/3 fast-import: fix corner case for checkpointDmitry Ivankov, Sep 18, 2011
  5. Jonathan NiederSep 18, 2011
  6. 3/3 fast-import: rename object_count to pack_object_countDmitry Ivankov, Sep 18, 2011
  7. Jonathan NiederSep 18, 2011
  8. Dmitry IvankovSep 18, 2011
  9. Jonathan NiederSep 18, 2011

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.