Skip to content

Commit 7bbd8d6

Browse files
committed
Merge branch 'maint'
* maint: t3404: Add test case for auto-amending only edited commits after "edit" t3404: Add test case for aborted --continue after "edit" t3501: check that commits are actually done
2 parents a42577d + ebb7bbf commit 7bbd8d6

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

t/t3404-rebase-interactive.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,38 @@ test_expect_success '--continue tries to commit, even for "edit"' '
373373
test $parent = $(git rev-parse HEAD^)
374374
'
375375

376+
test_expect_success 'aborted --continue does not squash commits after "edit"' '
377+
old=$(git rev-parse HEAD) &&
378+
test_tick &&
379+
FAKE_LINES="edit 1" git rebase -i HEAD^ &&
380+
echo "edited again" > file7 &&
381+
git add file7 &&
382+
(
383+
FAKE_COMMIT_MESSAGE=" " &&
384+
export FAKE_COMMIT_MESSAGE &&
385+
test_must_fail git rebase --continue
386+
) &&
387+
test $old = $(git rev-parse HEAD) &&
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+
376408
test_expect_success 'rebase a detached HEAD' '
377409
grandparent=$(git rev-parse HEAD~2) &&
378410
git checkout $(git rev-parse HEAD) &&

t/t3501-revert-cherry-pick.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ test_expect_success 'cherry-pick after renaming branch' '
4545
4646
git checkout rename2 &&
4747
git cherry-pick added &&
48+
test $(git rev-parse HEAD^) = $(git rev-parse rename2) &&
4849
test -f opos &&
4950
grep "Add extra line at the end" opos
5051
@@ -54,6 +55,7 @@ test_expect_success 'revert after renaming branch' '
5455
5556
git checkout rename1 &&
5657
git revert added &&
58+
test $(git rev-parse HEAD^) = $(git rev-parse rename1) &&
5759
test -f spoo &&
5860
! grep "Add extra line at the end" spoo
5961

0 commit comments

Comments
 (0)