summaryrefslogtreecommitdiff
path: root/t/t1503-rev-parse-verify.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t1503-rev-parse-verify.sh')
-rwxr-xr-xt/t1503-rev-parse-verify.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/t/t1503-rev-parse-verify.sh b/t/t1503-rev-parse-verify.sh
index 95244c9bcf..813cc1b3e2 100755
--- a/t/t1503-rev-parse-verify.sh
+++ b/t/t1503-rev-parse-verify.sh
@@ -23,7 +23,7 @@ add_line_into_file()
fi
test_tick
- git-commit --quiet -m "$MSG" $_file
+ git commit --quiet -m "$MSG" $_file
}
HASH1=
@@ -104,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