Merge branch 'jk/fast-import-die-nicely-fix'

"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
This commit is contained in:
Junio C Hamano 2015-02-25 15:40:15 -08:00
commit 1585dfeda7

View File

@ -947,9 +947,12 @@ static void unkeep_all_packs(void)
static void end_packfile(void) static void end_packfile(void)
{ {
if (!pack_data) static int running;
if (running || !pack_data)
return; return;
running = 1;
clear_delta_base_cache(); clear_delta_base_cache();
if (object_count) { if (object_count) {
struct packed_git *new_p; struct packed_git *new_p;
@ -999,6 +1002,7 @@ static void end_packfile(void)
} }
free(pack_data); free(pack_data);
pack_data = NULL; pack_data = NULL;
running = 0;
/* We can't carry a delta across packfiles. */ /* We can't carry a delta across packfiles. */
strbuf_release(&last_blob.data); strbuf_release(&last_blob.data);