summaryrefslogtreecommitdiff
path: root/builtin/index-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-02-14 20:54:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-02-14 20:54:24 (GMT)
commit7b029ebaefd945b2315281fcdf9c35843641623b (patch)
tree4c8ac3dbc5ab714f6481773faa5d553cbf3577d6 /builtin/index-pack.c
parentaa21cc97bd10ab0b62f6d951ff2ff725261e326e (diff)
parenta21781011f80c9fcb31e84c7a164611491d8c663 (diff)
downloadgit-7b029ebaefd945b2315281fcdf9c35843641623b.zip
git-7b029ebaefd945b2315281fcdf9c35843641623b.tar.gz
git-7b029ebaefd945b2315281fcdf9c35843641623b.tar.bz2
Merge branch 'jk/index-pack-dupfix'
The index-pack code now diagnoses a bad input packstream that records the same object twice when it is used as delta base; the code used to declare a software bug when encountering such an input, but it is an input error. * jk/index-pack-dupfix: index-pack: downgrade twice-resolved REF_DELTA to die()
Diffstat (limited to 'builtin/index-pack.c')
-rw-r--r--builtin/index-pack.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index acdda17..d967d18 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -1004,7 +1004,9 @@ static struct base_data *find_unresolved_deltas_1(struct base_data *base,
if (!compare_and_swap_type(&child->real_type, OBJ_REF_DELTA,
base->obj->real_type))
- BUG("child->real_type != OBJ_REF_DELTA");
+ die("REF_DELTA at offset %"PRIuMAX" already resolved (duplicate base %s?)",
+ (uintmax_t)child->idx.offset,
+ oid_to_hex(&base->obj->idx.oid));
resolve_delta(child, base, result);
if (base->ref_first == base->ref_last && base->ofs_last == -1)