mirror of
https://github.com/git/git.git
synced 2024-11-25 10:54:00 +08:00
831c61cc6b
Adjust the test so that it uses variables and command substitution for trees instead of hard-coded hashes. This also has the benefit of making it more obvious how the test works. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
26 lines
466 B
Bash
Executable File
26 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
|