git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] t5302: confirm that large packs mention limit

From
MGMatt Cooper via GitGitGadget <gitgitgadget@gmail.com>
Date
Feb 23, 2022, 16:03 UTC
Message-ID
<43990408a10d65058d872f13ea9619e85de7081d.1645632193.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1158.git.1645632193.gitgitgadget@gmail.com>
From: Matt Cooper <vtbassmatt@gmail.com>

When a pack can't be processed because it's too large, we report the exact nature of the breach. This test ensures that the error message has a human-readable size included.

Signed-off-by: Matt Cooper <vtbassmatt@gmail.com>
Helped-by: Taylor Blau <me@ttaylorr.com>
Helped-by: Derrick Stolee <derrickstolee@github.com>
---
 t/t5302-pack-index.sh | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh
index 8ee67df38f6..b0095ab41d3 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
-- 
gitgitgadget
Previous: Matt Cooper via GitGitGadgetNext: Taylor Blau
Message 3 of 9 in “Specify the actual pack size limit which is breached”
  1. 0/2 Specify the actual pack size limit which is breachedMatt Cooper via GitGitGadget, Feb 23, 2022
  2. 1/2 index-pack: clarify the breached limitMatt Cooper via GitGitGadget, Feb 23, 2022
  3. 2/2 t5302: confirm that large packs mention limitMatt Cooper via GitGitGadget, Feb 23, 2022
  4. Taylor BlauFeb 23, 2022
  5. Junio C HamanoFeb 23, 2022
  6. Taylor BlauFeb 23, 2022
  7. Taylor BlauFeb 23, 2022
  8. index-pack: clarify the breached limitMatt Cooper via GitGitGadget, Feb 24, 2022
  9. Ævar Arnfjörð BjarmasonFeb 24, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.