summaryrefslogtreecommitdiff
path: root/fast-import.c
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-02-07 07:42:44 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-02-07 07:42:44 (GMT)
commit820b9310127afe3533bb57034d6f458f5aed3e7e (patch)
treee579cc8fa4d21d43a6b0e20e798203231ab55aeb /fast-import.c
parentc499d76849b09194434708376138952e2cac2e68 (diff)
downloadgit-820b9310127afe3533bb57034d6f458f5aed3e7e.zip
git-820b9310127afe3533bb57034d6f458f5aed3e7e.tar.gz
git-820b9310127afe3533bb57034d6f458f5aed3e7e.tar.bz2
Dump all refs and marks during a checkpoint in fast-import.
If the frontend asks us to checkpoint (via the explicit checkpoint command) its probably because they are afraid the current import will crash/fail/whatever and want to make sure they can pickup from the last checkpoint. To do that sort of recovery, we will need the current tip of every branch and tag available at the next startup. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'fast-import.c')
-rw-r--r--fast-import.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/fast-import.c b/fast-import.c
index 858df17..d9ed3e2 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -838,7 +838,7 @@ static void end_packfile(void)
last_blob.depth = 0;
}
-static void checkpoint(void)
+static void cycle_packfile(void)
{
end_packfile();
start_packfile();
@@ -931,7 +931,7 @@ static int store_object(
/* This new object needs to *not* have the current pack_id. */
e->pack_id = pack_id + 1;
- checkpoint();
+ cycle_packfile();
/* We cannot carry a delta into the new pack. */
if (delta) {
@@ -1940,8 +1940,12 @@ static void cmd_reset_branch(void)
static void cmd_checkpoint(void)
{
- if (object_count)
- checkpoint();
+ if (object_count) {
+ cycle_packfile();
+ dump_branches();
+ dump_tags();
+ dump_marks();
+ }
read_next_command();
}