test-lib: allow negation of prerequisites
[gitweb.git] / t / t1512-rev-parse-disambiguation.sh
index 6de3cb0c920d8d2943c2e0f1c05eb1af4cd182fe..6b3d797ceabad069aefd1337ffe366b86b523412 100755 (executable)
@@ -98,7 +98,7 @@ test_expect_success 'disambiguate commit-ish' '
 '
 
 test_expect_success 'disambiguate commit' '
-       commit=$(echo "j9xqh" | git commit-tree 0000000000cdc -p 000000000) &&
+       commit=$(echo "hoaxj" | git commit-tree 0000000000cdc -p 000000000) &&
        test $(git rev-parse $commit^) = $(git rev-parse 0000000000e4f)
 '
 
@@ -252,4 +252,13 @@ test_expect_success 'ambiguous commit-ish' '
        test_must_fail git log 000000000...
 '
 
+test_expect_success 'rev-parse --disambiguate' '
+       # The test creates 16 objects that share the prefix and two
+       # commits created by commit-tree in earlier tests share a
+       # different prefix.
+       git rev-parse --disambiguate=000000000 >actual &&
+       test $(wc -l <actual) = 16 &&
+       test "$(sed -e "s/^\(.........\).*/\1/" actual | sort -u)" = 000000000
+'
+
 test_done