summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-03-05 13:13:12 -0800
committerJunio C Hamano <gitster@pobox.com>2015-03-05 13:13:13 -0800
commit4e0d6207e58fe19be9343395c979bcb92d09b4a9 (patch)
treeff9749969b8858c9e37eb8dd343984bd19f1e445
parent007f7f6e544b89a7efc0dcb5f11a4d5bf5180c3f (diff)
parent5e915f3085db3c0edbc80269f889341172e8595b (diff)
downloadgit-4e0d6207e58fe19be9343395c979bcb92d09b4a9.tar.gz
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
-rw-r--r--fast-import.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fast-import.c b/fast-import.c
index d0bd285a16..aac2c24f74 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -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;
@@ -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);