Skip to content

Commit

Permalink
Merge branch 'jk/fast-import-die-nicely-fix'
Browse files Browse the repository at this point in the history
"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
  • Loading branch information
Junio C Hamano committed Feb 25, 2015
2 parents a75c663 + 5e915f3 commit 1585dfe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fast-import.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,9 +947,12 @@ static void unkeep_all_packs(void)

static void end_packfile(void)
{
if (!pack_data)
static int running;

if (running || !pack_data)
return;

running = 1;
clear_delta_base_cache();
if (object_count) {
struct packed_git *new_p;
Expand Down Expand Up @@ -999,6 +1002,7 @@ static void end_packfile(void)
}
free(pack_data);
pack_data = NULL;
running = 0;

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

0 comments on commit 1585dfe

Please sign in to comment.