Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-10-01 12:16:50 +0300
committerJunio C Hamano <gitster@pobox.com>2021-10-02 01:06:00 +0300
commit5848fb11acd0b6aad6ba9e3e71bd91485e0d4c71 (patch)
tree1a8828ad2e306599bd10a234c2edcb502cce75fc /t/t1006-cat-file.sh
parent3b6a8db3b03adb118bfafb90bbc710068dbd6d14 (diff)
object-file.c: return ULHR_TOO_LONG on "header too long"
Split up the return code for "header too long" from the generic negative return value unpack_loose_header() returns, and report via error() if we exceed MAX_HEADER_LEN. As a test added earlier in this series in t1006-cat-file.sh shows we'll correctly emit zlib errors from zlib.c already in this case, so we have no need to carry those return codes further down the stack. Let's instead just return ULHR_TOO_LONG saying we ran into the MAX_HEADER_LEN limit, or other negative values for "unable to unpack <OID> header". Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1006-cat-file.sh')
-rwxr-xr-xt/t1006-cat-file.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t1006-cat-file.sh b/t/t1006-cat-file.sh
index c89483f40b..4b55adf06a 100755
--- a/t/t1006-cat-file.sh
+++ b/t/t1006-cat-file.sh
@@ -356,12 +356,12 @@ do
if test "$arg2" = "-p"
then
cat >expect <<-EOF
- error: unable to unpack $bogus_long_sha1 header
+ error: header for $bogus_long_sha1 too long, exceeds 32 bytes
fatal: Not a valid object name $bogus_long_sha1
EOF
else
cat >expect <<-EOF
- error: unable to unpack $bogus_long_sha1 header
+ error: header for $bogus_long_sha1 too long, exceeds 32 bytes
fatal: git cat-file: could not get object info
EOF
fi &&