aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/index-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-03-06 21:25:32 -0800
committerJunio C Hamano <gitster@pobox.com>2022-03-06 21:25:32 -0800
commit283e4e7cd35ae61d86e6a3a61cfea283adc09ba5 (patch)
treec91177c0883fdbd4e347cc7f532fe281a2368089 /builtin/index-pack.c
parent6d8d81ec36081328638a886664e8d54434ca729a (diff)
parent0cf5fbc2e4ee124b4dc583fac6f7ad697616a56a (diff)
downloadgit-283e4e7cd35ae61d86e6a3a61cfea283adc09ba5.tar.gz
Merge branch 'mc/index-pack-report-max-size'
When "index-pack" dies due to incoming data exceeding the maximum allowed input size, include the value of the limit in the error message. * mc/index-pack-report-max-size: index-pack: clarify the breached limit
Diffstat (limited to 'builtin/index-pack.c')
-rw-r--r--builtin/index-pack.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index 3c2e6aee3c..c45273de3b 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -323,8 +323,12 @@ static void use(int bytes)
if (signed_add_overflows(consumed_bytes, bytes))
die(_("pack too large for current definition of off_t"));
consumed_bytes += bytes;
- if (max_input_size && consumed_bytes > max_input_size)
- die(_("pack exceeds maximum allowed size"));
+ if (max_input_size && consumed_bytes > max_input_size) {
+ struct strbuf size_limit = STRBUF_INIT;
+ strbuf_humanise_bytes(&size_limit, max_input_size);
+ die(_("pack exceeds maximum allowed size (%s)"),
+ size_limit.buf);
+ }
}
static const char *open_pack_file(const char *pack_name)