From: Junio C Hamano Date: Sun, 30 Aug 2020 16:15:10 GMT Subject: Re: [PATCH] Avoid infinite loop in malformed packfiles Message-ID: In-Reply-To: <59efeeab-49de-17e7-8b1c-355d6ef31b5d@web.de> René Scharfe writes: >> Will that work? I'd expect that modern pack files end up being >> offset deltas, rather than reference deltas. > > True, but going down all the way would work: Perhaps, but I'd rather use pack-objects to prepare the repository with no-delta-base-offset to force ref deltas. > diff --git a/t/t5316-pack-delta-depth.sh b/t/t5316-pack-delta-depth.sh > index 0f06c40eb1..7fd21cd3ce 100755 > --- a/t/t5316-pack-delta-depth.sh > +++ b/t/t5316-pack-delta-depth.sh > @@ -94,4 +94,15 @@ test_expect_success '--depth limits depth' ' > test_i18ncmp expect actual > ' > > +test_expect_success 'maxAllowedDeltaDepth is respected' ' > + git clone . clone1 && > + ( > + cd clone1 && > + git repack -a -d && > + test_config core.maxAllowedDeltaDepth 0 && > + test_must_fail git fsck 2>err && > + test_i18ngrep "overlong delta chain" err > + ) > +' > + > test_done