Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Junio C Hamano committed Jan 16, 2009
2 parents a42577d + ebb7bbf commit 7bbd8d6
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
32 changes: 32 additions & 0 deletions t/t3404-rebase-interactive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,38 @@ test_expect_success '--continue tries to commit, even for "edit"' '
test $parent = $(git rev-parse HEAD^)
'

test_expect_success 'aborted --continue does not squash commits after "edit"' '
old=$(git rev-parse HEAD) &&
test_tick &&
FAKE_LINES="edit 1" git rebase -i HEAD^ &&
echo "edited again" > file7 &&
git add file7 &&
(
FAKE_COMMIT_MESSAGE=" " &&
export FAKE_COMMIT_MESSAGE &&
test_must_fail git rebase --continue
) &&
test $old = $(git rev-parse HEAD) &&
git rebase --abort
'

test_expect_success 'auto-amend only edited commits after "edit"' '
test_tick &&
FAKE_LINES="edit 1" git rebase -i HEAD^ &&
echo "edited again" > file7 &&
git add file7 &&
FAKE_COMMIT_MESSAGE="edited file7 again" git commit &&
echo "and again" > file7 &&
git add file7 &&
test_tick &&
(
FAKE_COMMIT_MESSAGE="and again" &&
export FAKE_COMMIT_MESSAGE &&
test_must_fail git rebase --continue
) &&
git rebase --abort
'

test_expect_success 'rebase a detached HEAD' '
grandparent=$(git rev-parse HEAD~2) &&
git checkout $(git rev-parse HEAD) &&
Expand Down
2 changes: 2 additions & 0 deletions t/t3501-revert-cherry-pick.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ test_expect_success 'cherry-pick after renaming branch' '
git checkout rename2 &&
git cherry-pick added &&
test $(git rev-parse HEAD^) = $(git rev-parse rename2) &&
test -f opos &&
grep "Add extra line at the end" opos
Expand All @@ -54,6 +55,7 @@ test_expect_success 'revert after renaming branch' '
git checkout rename1 &&
git revert added &&
test $(git rev-parse HEAD^) = $(git rev-parse rename1) &&
test -f spoo &&
! grep "Add extra line at the end" spoo
Expand Down

0 comments on commit 7bbd8d6

Please sign in to comment.