summaryrefslogtreecommitdiffstats
path: root/t/t3103-ls-tree-misc.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 09:49:36 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 09:49:36 +0000
commit5ec6074f0633939fd17d94111d10c6c6b062978c (patch)
treebfaa17b5a64abc66c918e9c70969e519d9e1df8e /t/t3103-ls-tree-misc.sh
parentInitial commit. (diff)
downloadgit-5ec6074f0633939fd17d94111d10c6c6b062978c.tar.xz
git-5ec6074f0633939fd17d94111d10c6c6b062978c.zip
Adding upstream version 1:2.30.2.upstream/1%2.30.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 't/t3103-ls-tree-misc.sh')
-rwxr-xr-xt/t3103-ls-tree-misc.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/t3103-ls-tree-misc.sh b/t/t3103-ls-tree-misc.sh
new file mode 100755
index 0000000..1452091
--- /dev/null
+++ b/t/t3103-ls-tree-misc.sh
@@ -0,0 +1,25 @@
+#!/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