summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rwxr-xr-xt/t1503-rev-parse-verify.sh4
-rwxr-xr-xt/t1508-at-combinations.sh13
2 files changed, 15 insertions, 2 deletions
diff --git a/t/t1503-rev-parse-verify.sh b/t/t1503-rev-parse-verify.sh
index dc9fe3c..a7e9b48 100755
--- a/t/t1503-rev-parse-verify.sh
+++ b/t/t1503-rev-parse-verify.sh
@@ -86,8 +86,8 @@ test_expect_success 'fails silently when using -q' '
test_expect_success 'fails silently when using -q with deleted reflogs' '
ref=$(git rev-parse HEAD) &&
git update-ref --create-reflog -m "message for refs/test" refs/test "$ref" &&
- git reflog delete --updateref --rewrite refs/test@{0} &&
- test_must_fail git rev-parse -q --verify refs/test@{0} >error 2>&1 &&
+ git reflog delete --updateref --rewrite refs/test@{1} &&
+ test_must_fail git rev-parse -q --verify refs/test@{1} >error 2>&1 &&
test_must_be_empty error
'
diff --git a/t/t1508-at-combinations.sh b/t/t1508-at-combinations.sh
index 4a9964e..e4521b7 100755
--- a/t/t1508-at-combinations.sh
+++ b/t/t1508-at-combinations.sh
@@ -99,4 +99,17 @@ test_expect_success 'create path with @' '
check "@:normal" blob content
check "@:fun@ny" blob content
+test_expect_success '@{1} works with only one reflog entry' '
+ git checkout -B newbranch master &&
+ git reflog expire --expire=now refs/heads/newbranch &&
+ git commit --allow-empty -m "first after expiration" &&
+ test_cmp_rev newbranch~ newbranch@{1}
+'
+
+test_expect_success '@{0} works with empty reflog' '
+ git checkout -B newbranch master &&
+ git reflog expire --expire=now refs/heads/newbranch &&
+ test_cmp_rev newbranch newbranch@{0}
+'
+
test_done