aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-01-15 18:52:35 -0800
committerJunio C Hamano <gitster@pobox.com>2009-01-15 18:52:35 -0800
commit7bbd8d6c139f163ee26b8416cd227408888f31c3 (patch)
treea6d417bf52c25913b916bf0b3493a8a06813ac11
parenta42577d4c868141343378824814c058de043e24d (diff)
parentebb7bbf769e3785e882dffcce69816b88e0838f5 (diff)
downloadgit-7bbd8d6c139f163ee26b8416cd227408888f31c3.tar.gz
git-7bbd8d6c139f163ee26b8416cd227408888f31c3.tar.xz
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
-rwxr-xr-xt/t3404-rebase-interactive.sh32
-rwxr-xr-xt/t3501-revert-cherry-pick.sh2
2 files changed, 34 insertions, 0 deletions
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 7d10a27f1..2cc8e7abe 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -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) &&
diff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh
index 6da212825..bb4cf00d7 100755
--- a/t/t3501-revert-cherry-pick.sh
+++ b/t/t3501-revert-cherry-pick.sh
@@ -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
@@ -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