Skip to content

Commit 723b74e

Browse files
artagnongitster
authored andcommitted
tests: at-combinations: @{N} versus HEAD@{N}
All the tests so far check that @{N} is the same as HEAD@{N} (for positive N). However, this is not always the case; write a couple of tests for this. [fc: simplify some wording] Signed-off-by: Ramkumar Ramachandra <[email protected]> Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f58dc19 commit 723b74e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

t/t1508-at-combinations.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,17 @@ nonsense "@{1}@{u}"
6161
nonsense "HEAD@{-1}"
6262
nonsense "@{-1}@{-1}"
6363

64+
# @{N} versus HEAD@{N}
65+
66+
check "HEAD@{3}" commit old-two
67+
nonsense "@{3}"
68+
69+
test_expect_success 'switch to old-branch' '
70+
git checkout old-branch
71+
'
72+
73+
check HEAD ref refs/heads/old-branch
74+
check "HEAD@{1}" commit new-two
75+
check "@{1}" commit old-one
76+
6477
test_done

0 commit comments

Comments
 (0)