path: root/fast-import.c
diff options
authorShawn O. Pearce <>2008-02-14 06:34:43 (GMT)
committerJunio C Hamano <>2008-02-16 08:47:07 (GMT)
commit118805b92097e355001bb16687ce252646eab604 (patch)
tree688f2e412aafd1fb32854f26ad1b33514aec1e9d /fast-import.c
parent3b08e5b8c9130f57a38e51557dbb173b9edda5ba (diff)
Finish current packfile during fast-import crash handler
If fast-import is in the middle of crashing due to a protocol error or something like that then it can be very useful to have the mark table and all objects up until that point be available for a new import to resume from. Currently we just close the active packfile, unkeep all of our newly created packfiles (so they can be deleted), and dump the marks table to a temporary file. We don't attempt to update the refs/tags that the process has in memory as much of that data can be found in the crash report and I'm not sure it would be the right thing to do under every type of crash. Signed-off-by: Shawn O. Pearce <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'fast-import.c')
1 files changed, 7 insertions, 0 deletions
diff --git a/fast-import.c b/fast-import.c
index 117f38c..0d3449f 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -459,6 +459,10 @@ static void write_crash_report(const char *err)
+static void end_packfile(void);
+static void unkeep_all_packs(void);
+static void dump_marks(void);
static NORETURN void die_nicely(const char *err, va_list params)
static int zombie;
@@ -472,6 +476,9 @@ static NORETURN void die_nicely(const char *err, va_list params)
if (!zombie) {
zombie = 1;
+ end_packfile();
+ unkeep_all_packs();
+ dump_marks();