Skip to content

Commit 2559bff

Browse files
j6tgitster
authored andcommitted
t3400-rebase: Move detached HEAD check earlier
Short story: There is a section in t3400 that tests fundamental rebase properties. 3ec7371 (Add two extra tests for git rebase, 2009-02-09) added a check that rebase works on a detached HEAD, but the test was put near the end of the file. This moves it to a more suitable place. Long story: The test that preceded the one in question tests that a rebased commit degrades from a content change with mode change to a mere mode change. But on Windows, where we have core.filemode=false, the original commit did not record the mode change, and so the rebase operation did not rebase anything. This caused the subsequent detached HEAD test to fail. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent f8c6288 commit 2559bff

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

t/t3400-rebase.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ test_expect_success \
4848
'the rebase operation should not have destroyed author information' \
4949
'! (git log | grep "Author:" | grep "<>")'
5050

51+
test_expect_success 'HEAD was detached during rebase' '
52+
test $(git rev-parse HEAD@{1}) != $(git rev-parse my-topic-branch@{1})
53+
'
54+
5155
test_expect_success 'rebase after merge master' '
5256
git reset --hard topic &&
5357
git merge master &&
@@ -85,10 +89,6 @@ test_expect_success 'rebase a single mode change' '
8589
GIT_TRACE=1 git rebase master
8690
'
8791

88-
test_expect_success 'HEAD was detached during rebase' '
89-
test $(git rev-parse HEAD@{1}) != $(git rev-parse modechange@{1})
90-
'
91-
9292
test_expect_success 'Show verbose error when HEAD could not be detached' '
9393
: > B &&
9494
test_must_fail git rebase topic 2> output.err > output.out &&

0 commit comments

Comments
 (0)