Commit 3b08e5b8 authored by Shawn O. Pearce's avatar Shawn O. Pearce Committed by Junio C Hamano

Include the fast-import marks table in crash reports

If fast-import was not run with --export-marks but we are crashing
the frontend application developer may still benefit from having
that information available to them.  We now include the marks table
as part of the crash report if --export-marks was not supplied on
the command line.
Signed-off-by: default avatarShawn O. Pearce <[email protected]>
Signed-off-by: default avatarJunio C Hamano <[email protected]>
parent fbc63ea6
......@@ -372,6 +372,8 @@ static void write_branch_report(FILE *rpt, struct branch *b)
fputc('\n', rpt);
}
static void dump_marks_helper(FILE *, uintmax_t, struct mark_set *);
static void write_crash_report(const char *err)
{
char *loc = git_path("fast_import_crash_%d", getpid());
......@@ -443,6 +445,14 @@ static void write_crash_report(const char *err)
}
}
fputc('\n', rpt);
fputs("Marks\n", rpt);
fputs("-----\n", rpt);
if (mark_file)
fprintf(rpt, " exported to %s\n", mark_file);
else
dump_marks_helper(rpt, 0, marks);
fputc('\n', rpt);
fputs("-------------------\n", rpt);
fputs("END OF CRASH REPORT\n", rpt);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment