Skip to content

Commit e4b09da

Browse files
Nanako Shiraishigitster
authored andcommitted
test: checkout shouldn't say that HEAD has moved if it didn't
Signed-off-by: しらいしななこ <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent dd42c2f commit e4b09da

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

t/t7201-co.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,4 +534,12 @@ test_expect_success 'failing checkout -b should not break working tree' '
534534
535535
'
536536

537+
test_expect_success 'switch out of non-branch' '
538+
git reset --hard master &&
539+
git checkout master^0 &&
540+
echo modified >one &&
541+
test_must_fail git checkout renamer 2>error.log &&
542+
! grep "^Previous HEAD" error.log
543+
'
544+
537545
test_done

0 commit comments

Comments
 (0)