Skip to content

Commit f8aa1b6

Browse files
sbeyergitster
authored andcommitted
t3404: Add test case for auto-amending only edited commits after "edit"
Add a test case for the bugfix introduced by commit c14c3c8 "git-rebase--interactive: auto amend only edited commit". Signed-off-by: Stephan Beyer <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent dc7f55c commit f8aa1b6

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

t/t3404-rebase-interactive.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,23 @@ test_expect_success 'aborted --continue does not squash commits after "edit"' '
388388
git rebase --abort
389389
'
390390

391+
test_expect_success 'auto-amend only edited commits after "edit"' '
392+
test_tick &&
393+
FAKE_LINES="edit 1" git rebase -i HEAD^ &&
394+
echo "edited again" > file7 &&
395+
git add file7 &&
396+
FAKE_COMMIT_MESSAGE="edited file7 again" git commit &&
397+
echo "and again" > file7 &&
398+
git add file7 &&
399+
test_tick &&
400+
(
401+
FAKE_COMMIT_MESSAGE="and again" &&
402+
export FAKE_COMMIT_MESSAGE &&
403+
test_must_fail git rebase --continue
404+
) &&
405+
git rebase --abort
406+
'
407+
391408
test_expect_success 'rebase a detached HEAD' '
392409
grandparent=$(git rev-parse HEAD~2) &&
393410
git checkout $(git rev-parse HEAD) &&

0 commit comments

Comments
 (0)