t3404: Add test case for auto-amending only edited commits after "edit"
Add a test case for the bugfix introduced by commit c14c3c82d "git-rebase--interactive: auto amend only edited commit". Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Stephan Beyer committed
Jan 15, 2009 at 13:56 UTC
f8aa1b6902d7a77c26b0ef615c9070bbed4be5c4
1 file changed
+17
t/t3404-rebase-interactive.sh
+17
@@ -388,6 +388,23 @@ test_expect_success 'aborted --continue does not squash commits after "edit"' '
388
git rebase --abort
389
'
390
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
+
408
test_expect_success 'rebase a detached HEAD' '
409
grandparent=$(git rev-parse HEAD~2) &&
410
git checkout $(git rev-parse HEAD) &&