Code

diff -p: squelch "diff --git" header for stat-dirty paths
[git.git] / t / t1506-rev-parse-diagnosis.sh
index af721f97192d70457b289d623c70f18569f5134a..0eeeb0e45090661c0576607792ff9b91d096e282 100755 (executable)
@@ -66,4 +66,13 @@ test_expect_success 'incorrect file in :path and :N:path' '
        grep "fatal: Path '"'"'disk-only.txt'"'"' exists on disk, but not in the index." error
 '
 
+test_expect_success 'invalid @{n} reference' '
+       test_must_fail git rev-parse master@{99999} >output 2>error &&
+       test -z "$(cat output)" &&
+       grep "fatal: Log for [^ ]* only has [0-9][0-9]* entries." error  &&
+       test_must_fail git rev-parse --verify master@{99999} >output 2>error &&
+       test -z "$(cat output)" &&
+       grep "fatal: Log for [^ ]* only has [0-9][0-9]* entries." error
+'
+
 test_done