summaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-06-23 21:53:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-06-23 21:53:20 (GMT)
commitee64e345b1ac13cbb9c6a2343453fa3fc798367a (patch)
treef410dbf23e0cb15a71e853358b8610b470360121 /sha1_file.c
parent23983a473dc889cfba8a64f040942298a6f5f99a (diff)
parent1ee886c1f08f4dd672a342b7811191b02291a597 (diff)
downloadgit-ee64e345b1ac13cbb9c6a2343453fa3fc798367a.zip
git-ee64e345b1ac13cbb9c6a2343453fa3fc798367a.tar.gz
git-ee64e345b1ac13cbb9c6a2343453fa3fc798367a.tar.bz2
Merge branch 'jk/unpack-entry-fallback-to-another'
* jk/unpack-entry-fallback-to-another: unpack_entry: do not die when we fail to apply a delta t5303: drop "count=1" from corruption dd
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 16f08d4..0af19c0 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -2145,8 +2145,17 @@ void *unpack_entry(struct packed_git *p, off_t obj_offset,
data = patch_delta(base, base_size,
delta_data, delta_size,
&size);
+
+ /*
+ * We could not apply the delta; warn the user, but keep going.
+ * Our failure will be noticed either in the next iteration of
+ * the loop, or if this is the final delta, in the caller when
+ * we return NULL. Those code paths will take care of making
+ * a more explicit warning and retrying with another copy of
+ * the object.
+ */
if (!data)
- die("failed to apply delta");
+ error("failed to apply delta");
free(delta_data);
}