t1503: Fix arithmetic expansion syntax error when using dash
[gitweb.git] / t / t1503-rev-parse-verify.sh
index e93f1b38ef5a1af47fb962078d86f3a1cc35b10d..813cc1b3e29ec840deb63ad9c3c1dffd2187cdc5 100755 (executable)
@@ -23,7 +23,7 @@ add_line_into_file()
     fi
 
     test_tick
-    git-commit --quiet -m "$MSG" $_file
+    git commit --quiet -m "$MSG" $_file
 }
 
 HASH1=
@@ -83,17 +83,11 @@ test_expect_success 'fails silently when using -q' '
        test -z "$(cat error)"
 '
 
-test_expect_success 'no stdout output on error' '
+test_expect_success 'no stdout output on error' '
        test -z "$(git rev-parse --verify)" &&
        test -z "$(git rev-parse --verify foo)" &&
-       test -z "$(git rev-parse --verify baz HEAD)"
-'
-
-test_expect_failure '2 no stdout output on error' '
-       test -z "$(git rev-parse --verify HEAD bar)"
-'
-
-test_expect_failure '3 no stdout output on error' '
+       test -z "$(git rev-parse --verify baz HEAD)" &&
+       test -z "$(git rev-parse --verify HEAD bar)" &&
        test -z "$(git rev-parse --verify $HASH2 HEAD)"
 '
 
@@ -110,4 +104,15 @@ test_expect_success 'use --default' '
        test_must_fail git rev-parse --verify --default bar
 '
 
+test_expect_success 'master@{n} for various n' '
+       N=$(git reflog | wc -l) &&
+       Nm1=$(($N-1)) &&
+       Np1=$(($N+1)) &&
+       git rev-parse --verify master@{0} &&
+       git rev-parse --verify master@{1} &&
+       git rev-parse --verify master@{$Nm1} &&
+       test_must_fail git rev-parse --verify master@{$N} &&
+       test_must_fail git rev-parse --verify master@{$Np1}
+'
+
 test_done