summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--object-file.c2
-rwxr-xr-xt/t1006-cat-file.sh2
2 files changed, 3 insertions, 1 deletions
diff --git a/object-file.c b/object-file.c
index 5086633e21..0bc62b53d3 100644
--- a/object-file.c
+++ b/object-file.c
@@ -1273,7 +1273,7 @@ enum unpack_loose_header_result unpack_loose_header(git_zstream *stream,
obj_read_unlock();
status = git_inflate(stream, 0);
obj_read_lock();
- if (status < Z_OK)
+ if (status != Z_OK && status != Z_STREAM_END)
return ULHR_BAD;
/*
diff --git a/t/t1006-cat-file.sh b/t/t1006-cat-file.sh
index 04099f7b4a..609dabd5cf 100755
--- a/t/t1006-cat-file.sh
+++ b/t/t1006-cat-file.sh
@@ -865,6 +865,8 @@ test_expect_success 'object reading handles zlib dictionary' - <<\EOT
printf '\170\273\017\112\003\143' >$objpath &&
test_must_fail git cat-file blob $blob 2>err &&
+ test_grep ! 'too long' err &&
+ test_grep 'error: unable to unpack' err &&
test_grep 'error: inflate: needs dictionary' err
EOT