diff options
| author | Junio C Hamano <gitster@pobox.com> | 2021-01-25 14:19:18 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2021-01-25 14:19:18 -0800 |
| commit | 440acfbe0cec5c2316ef7a706c975143c4902b20 (patch) | |
| tree | 34a167f09449a657477686fbefcec31b32cd51b7 /t/t1508-at-combinations.sh | |
| parent | 080627942802e767b068a491f3d349227f4e2cdc (diff) | |
| parent | 6436a20284f33d42103cac93bd82e65bebb31526 (diff) | |
| download | git-440acfbe0cec5c2316ef7a706c975143c4902b20.tar.gz | |
Merge branch 'dl/reflog-with-single-entry'
After expiring a reflog and making a single commit, the reflog for
the branch would record a single entry that knows both @{0} and
@{1}, but we failed to answer "what commit were we on?", i.e. @{1}
* dl/reflog-with-single-entry:
refs: allow @{n} to work with n-sized reflog
refs: factor out set_read_ref_cutoffs()
Diffstat (limited to 't/t1508-at-combinations.sh')
| -rwxr-xr-x | t/t1508-at-combinations.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t1508-at-combinations.sh b/t/t1508-at-combinations.sh index 4a9964e9dc..e4521b7b97 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 |
