pack-objects: simplify --filter handling
[git/debian.git] / t / t3103-ls-tree-misc.sh
blob81c6343962381fc17b1bff4d3ca8958951bde70d
1 #!/bin/sh
3 test_description='
4 Miscellaneous tests for git ls-tree.
6 1. git ls-tree fails in presence of tree damage.
10 TEST_PASSES_SANITIZE_LEAK=true
11 . ./test-lib.sh
13 test_expect_success 'setup' '
14 mkdir a &&
15 touch a/one &&
16 git add a/one &&
17 git commit -m test
20 test_expect_success 'ls-tree fails with non-zero exit code on broken tree' '
21 tree=$(git rev-parse HEAD:a) &&
22 rm -f .git/objects/$(echo $tree | sed -e "s,^\(..\),\1/,") &&
23 test_must_fail git ls-tree -r HEAD
26 for opts in \
27 "--long --name-only" \
28 "--name-only --name-status" \
29 "--name-status --object-only" \
30 "--object-only --long"
32 test_expect_success "usage: incompatible options: $opts" '
33 test_expect_code 129 git ls-tree $opts $tree
36 one_opt=$(echo "$opts" | cut -d' ' -f1)
37 test_expect_success "usage: incompatible options: $one_opt and --format" '
38 test_expect_code 129 git ls-tree $one_opt --format=fmt $tree
40 done
41 test_done