Skip to content

Commit

Permalink
t3404: begin "exchange commits with -p" test with correct preconditions
Browse files Browse the repository at this point in the history
The test case shows a bug in 'rebase -p', but even if the bug were fixed
the test would fail because it did not ensure that the preconditions match
the postconditions that were checked. Insert the suitable 'git checkout'.

Signed-off-by: Johannes Sixt <[email protected]>
Acked-by: Jonathan Nieder <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
j6t authored and gitster committed May 20, 2012
1 parent 042e9f9 commit 27ccd8d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions t/t3404-rebase-interactive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ test_expect_success '-p handles "no changes" gracefully' '
'

test_expect_failure 'exchange two commits with -p' '
git checkout H &&
FAKE_LINES="2 1" git rebase -i -p HEAD~2 &&
test H = $(git cat-file commit HEAD^ | sed -ne \$p) &&
test G = $(git cat-file commit HEAD | sed -ne \$p)
Expand Down

0 comments on commit 27ccd8d

Please sign in to comment.