tvl-depot/t/t3103-ls-tree-misc.sh
Vincent Ambo 1b593e1ea4 Squashed 'third_party/git/' content from commit cb71568594
git-subtree-dir: third_party/git
git-subtree-split: cb715685942260375e1eb8153b0768a376e4ece7
2020-01-11 23:36:56 +00:00

25 lines
466 B
Bash
Executable file

#!/bin/sh
test_description='
Miscellaneous tests for git ls-tree.
1. git ls-tree fails in presence of tree damage.
'
. ./test-lib.sh
test_expect_success 'setup' '
mkdir a &&
touch a/one &&
git add a/one &&
git commit -m test
'
test_expect_success 'ls-tree fails with non-zero exit code on broken tree' '
tree=$(git rev-parse HEAD:a) &&
rm -f .git/objects/$(echo $tree | sed -e "s,^\(..\),\1/,") &&
test_must_fail git ls-tree -r HEAD
'
test_done