summaryrefslogtreecommitdiff
path: root/builtin/index-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-04-17 06:29:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-04-17 06:29:30 (GMT)
commitdfe46c5ce6e68d682f80f9874f0eb107e9fee797 (patch)
tree7af1c20e18cad0a46b8c2259416ecbd85a36c697 /builtin/index-pack.c
parent3c833cae446364872b759c7622af2760a2f81a11 (diff)
parent51054177b312ce0795f2866d4c3aed246eeccea9 (diff)
downloadgit-dfe46c5ce6e68d682f80f9874f0eb107e9fee797.zip
git-dfe46c5ce6e68d682f80f9874f0eb107e9fee797.tar.gz
git-dfe46c5ce6e68d682f80f9874f0eb107e9fee797.tar.bz2
Merge branch 'jk/loose-object-info-report-error'
Update error handling for codepath that deals with corrupt loose objects. * jk/loose-object-info-report-error: index-pack: detect local corruption in collision check sha1_loose_object_info: return error for corrupted objects
Diffstat (limited to 'builtin/index-pack.c')
-rw-r--r--builtin/index-pack.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index 197c519..4ff567d 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -810,6 +810,8 @@ static void sha1_object(const void *data, struct object_entry *obj_entry,
unsigned long has_size;
read_lock();
has_type = sha1_object_info(sha1, &has_size);
+ if (has_type < 0)
+ die(_("cannot read existing object info %s"), sha1_to_hex(sha1));
if (has_type != type || has_size != size)
die(_("SHA1 COLLISION FOUND WITH %s !"), sha1_to_hex(sha1));
has_data = read_sha1_file(sha1, &has_type, &has_size);