summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-12-23 13:59:46 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-12-23 13:59:46 -0800
commitc46f849f8a2050776688bee408dabc813a44a5c7 (patch)
tree5fbeb0473145c1176c1ffa135c376650b2673be0 /builtin
parentGit 2.30-rc1 (diff)
parentpack-redundant: fix crash when one packfile in repo (diff)
downloadtgif-c46f849f8a2050776688bee408dabc813a44a5c7.tar.xz
Merge branch 'jx/pack-redundant-on-single-pack'
"git pack-redandant" when there is only one packfile used to crash, which has been corrected. * jx/pack-redundant-on-single-pack: pack-redundant: fix crash when one packfile in repo
Diffstat (limited to 'builtin')
-rw-r--r--builtin/pack-redundant.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/builtin/pack-redundant.c b/builtin/pack-redundant.c
index 3e70f2a4c1..9fcea3e253 100644
--- a/builtin/pack-redundant.c
+++ b/builtin/pack-redundant.c
@@ -473,6 +473,12 @@ static void cmp_local_packs(void)
{
struct pack_list *subset, *pl = local_packs;
+ /* only one packfile */
+ if (!pl->next) {
+ llist_init(&pl->unique_objects);
+ return;
+ }
+
while ((subset = pl)) {
while ((subset = subset->next))
cmp_two_packs(pl, subset);