summaryrefslogtreecommitdiff
path: root/builtin/pack-redundant.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-12-23 21:59:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-12-23 21:59:46 (GMT)
commitc46f849f8a2050776688bee408dabc813a44a5c7 (patch)
tree5fbeb0473145c1176c1ffa135c376650b2673be0 /builtin/pack-redundant.c
parent6d3ef5b467eccd2769f1aa1c555d317d3c8dc707 (diff)
parent0696232390d237b64f970e538177ecfd979020d0 (diff)
downloadgit-c46f849f8a2050776688bee408dabc813a44a5c7.zip
git-c46f849f8a2050776688bee408dabc813a44a5c7.tar.gz
git-c46f849f8a2050776688bee408dabc813a44a5c7.tar.bz2
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/pack-redundant.c')
-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 3e70f2a..9fcea3e 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);