Skip to content

Commit 4e0d620

Browse files
committed
Merge branch 'jk/fast-import-die-nicely-fix' into maint
"git fast-import" used to crash when it could not close and conclude the resulting packfile cleanly. * jk/fast-import-die-nicely-fix: fast-import: avoid running end_packfile recursively
2 parents 007f7f6 + 5e915f3 commit 4e0d620

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

fast-import.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,9 +947,12 @@ static void unkeep_all_packs(void)
947947

948948
static void end_packfile(void)
949949
{
950-
if (!pack_data)
950+
static int running;
951+
952+
if (running || !pack_data)
951953
return;
952954

955+
running = 1;
953956
clear_delta_base_cache();
954957
if (object_count) {
955958
struct packed_git *new_p;
@@ -999,6 +1002,7 @@ static void end_packfile(void)
9991002
}
10001003
free(pack_data);
10011004
pack_data = NULL;
1005+
running = 0;
10021006

10031007
/* We can't carry a delta across packfiles. */
10041008
strbuf_release(&last_blob.data);

0 commit comments

Comments
 (0)