summaryrefslogtreecommitdiff
path: root/t/t5302-pack-index.sh
diff options
context:
space:
mode:
authorMatt Cooper <vtbassmatt@gmail.com>2022-02-24 00:07:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-02-24 01:41:10 (GMT)
commit0cf5fbc2e4ee124b4dc583fac6f7ad697616a56a (patch)
treef7e7566df0774ddb979487afc1d8f0ee30c6d906 /t/t5302-pack-index.sh
parente6ebfd0e8cbbd10878070c8a356b5ad1b3ca464e (diff)
downloadgit-0cf5fbc2e4ee124b4dc583fac6f7ad697616a56a.zip
git-0cf5fbc2e4ee124b4dc583fac6f7ad697616a56a.tar.gz
git-0cf5fbc2e4ee124b4dc583fac6f7ad697616a56a.tar.bz2
index-pack: clarify the breached limit
As a small courtesy to users, report what limit was breached. This is especially useful when a push exceeds a server-defined limit, since the user is unlikely to have configured the limit (their host did). Also demonstrate the human-readable message in a test. Helped-by: Taylor Blau <me@ttaylorr.com> Helped-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Matt Cooper <vtbassmatt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5302-pack-index.sh')
-rwxr-xr-xt/t5302-pack-index.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh
index 8ee67df..b0095ab 100755
--- a/t/t5302-pack-index.sh
+++ b/t/t5302-pack-index.sh
@@ -284,4 +284,12 @@ test_expect_success 'index-pack -v --stdin produces progress for both phases' '
test_i18ngrep "Resolving deltas" err
'
+test_expect_success 'too-large packs report the breach' '
+ pack=$(git pack-objects --all pack </dev/null) &&
+ sz="$(test_file_size pack-$pack.pack)" &&
+ test "$sz" -gt 20 &&
+ test_must_fail git index-pack --max-input-size=20 pack-$pack.pack 2>err &&
+ grep "maximum allowed size (20 bytes)" err
+'
+
test_done