diff options
Diffstat (limited to 't/t5302-pack-index.sh')
| -rwxr-xr-x | t/t5302-pack-index.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh index 413c99274c..9697448cb2 100755 --- a/t/t5302-pack-index.sh +++ b/t/t5302-pack-index.sh @@ -293,4 +293,20 @@ test_expect_success 'too-large packs report the breach' ' grep "maximum allowed size (20 bytes)" err ' +# git-index-pack(1) uses the default hash algorithm outside of the repository, +# and it has no way to tell it otherwise. So we can only run this test with the +# default hash algorithm, as it would otherwise fail to parse the tree. +test_expect_success DEFAULT_HASH_ALGORITHM 'index-pack --fsck-objects outside of a repo' ' + test_when_finished "rm -rf repo" && + git init repo && + ( + cd repo && + printf "100644 blob $(test_oid 001)\t.gitattributes\n" >tree && + git mktree --missing <tree >tree-oid && + git pack-objects <tree-oid pack && + test_must_fail nongit git index-pack --fsck-objects "$(pwd)"/pack-*.pack 2>err && + test_grep "cannot perform queued object checks outside of a repository" err + ) +' + test_done |
