Add a test to check that git ls-tree sets non-zero exit code on error.
Expected to fail at this commit, fixed by subsequent commit. Additional tests of adhoc or uncategorised nature should be added to this file. Improved-by: Jens Lehmann <Jens.Lehmann@web.de> Improved-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jon Seymour committed
Jul 25, 2011 at 00:59 UTC
6c1c14480ddf912fca5e09a6a7e66dee7793d2ea
1 file changed
+24
t/t3103-ls-tree-misc.sh
new
+24
@@ -0,0 +1,24 @@
1
+#!/bin/sh
2
+
3
+test_description='
4
+Miscellaneous tests for git ls-tree.
5
+
6
+ 1. git ls-tree fails in presence of tree damage.
7
+
8
+'
9
+
10
+. ./test-lib.sh
11
+
12
+test_expect_success 'setup' '
13
+ mkdir a &&
14
+ touch a/one &&
15
+ git add a/one &&
16
+ git commit -m test
17
+'
18
+
19
+test_expect_failure 'ls-tree fails with non-zero exit code on broken tree' '
20
+ rm -f .git/objects/5f/cffbd6e4c5c5b8d81f5e9314b20e338e3ffff5 &&
21
+ test_must_fail git ls-tree -r HEAD
22
+'
23
+
24
+test_done