]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t1506-rev-parse-diagnosis.sh
Merge branch 'js/update-index-ignore-removal-for-skip-worktree'
[thirdparty/git.git] / t / t1506-rev-parse-diagnosis.sh
index 4ee009da666f22f6ff1ddce93dc1f30924c6cc26..624d0a588fe6dda03b929cd4239f62e765efa04a 100755 (executable)
@@ -8,10 +8,9 @@ exec </dev/null
 
 test_did_you_mean ()
 {
-       sq="'" &&
        cat >expected <<-EOF &&
-       fatal: Path '$2$3' $4, but not ${5:-$sq$3$sq}.
-       Did you mean '$1:$2$3'${2:+ aka $sq$1:./$3$sq}?
+       fatal: Path '$2$3' $4, but not ${5:-$SQ$3$SQ}.
+       Did you mean '$1:$2$3'${2:+ aka $SQ$1:./$3$SQ}?
        EOF
        test_cmp expected error
 }
@@ -215,4 +214,12 @@ test_expect_success 'arg before dashdash must be a revision (ambiguous)' '
        test_cmp expect actual
 '
 
+test_expect_success 'reject Nth parent if N is too high' '
+       test_must_fail git rev-parse HEAD^100000000000000000000000000000000
+'
+
+test_expect_success 'reject Nth ancestor if N is too high' '
+       test_must_fail git rev-parse HEAD~100000000000000000000000000000000
+'
+
 test_done