All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Matt Cooper via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, me@ttaylorr.com, derrickstolee@github.com,
	Matt Cooper <vtbassmatt@gmail.com>,
	Matt Cooper <vtbassmatt@gmail.com>
Subject: [PATCH 2/2] t5302: confirm that large packs mention limit
Date: Wed, 23 Feb 2022 16:03:13 +0000	[thread overview]
Message-ID: <43990408a10d65058d872f13ea9619e85de7081d.1645632193.git.gitgitgadget@gmail.com> (raw)
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

  parent reply	other threads:[~2022-02-23 16:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-23 16:03 [PATCH 0/2] Specify the actual pack size limit which is breached Matt Cooper via GitGitGadget
2022-02-23 16:03 ` [PATCH 1/2] index-pack: clarify the breached limit Matt Cooper via GitGitGadget
2022-02-23 16:03 ` Matt Cooper via GitGitGadget [this message]
2022-02-23 17:22   ` [PATCH 2/2] t5302: confirm that large packs mention limit Taylor Blau
2022-02-23 23:26     ` Junio C Hamano
2022-02-23 23:41       ` Taylor Blau
2022-02-23 16:33 ` [PATCH 0/2] Specify the actual pack size limit which is breached Taylor Blau
2022-02-24  0:07 ` [PATCH v2] index-pack: clarify the breached limit Matt Cooper via GitGitGadget
2022-02-24  0:14   ` Ævar Arnfjörð Bjarmason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43990408a10d65058d872f13ea9619e85de7081d.1645632193.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=me@ttaylorr.com \
    --cc=vtbassmatt@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.