summaryrefslogtreecommitdiff
path: root/fast-import.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-02-25 23:40:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-02-25 23:40:15 (GMT)
commit1585dfeda7f5696db22e0e5098fa2b5f633dfa2d (patch)
treea9ceee252b669162b606fdc98419e7f6e6970efa /fast-import.c
parenta75c663cd2056919a58ea949c519aad90eddd2f5 (diff)
parent5e915f3085db3c0edbc80269f889341172e8595b (diff)
downloadgit-1585dfeda7f5696db22e0e5098fa2b5f633dfa2d.zip
git-1585dfeda7f5696db22e0e5098fa2b5f633dfa2d.tar.gz
git-1585dfeda7f5696db22e0e5098fa2b5f633dfa2d.tar.bz2
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
Diffstat (limited to 'fast-import.c')
-rw-r--r--fast-import.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fast-import.c b/fast-import.c
index d0bd285..aac2c24 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);