summaryrefslogtreecommitdiff
path: root/t/t3404-rebase-interactive.sh
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2010-01-14 05:54:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-01-14 08:27:57 (GMT)
commit6bdcd0d2fcca7c3985a078c8d343a863136fb675 (patch)
tree4ec799d5aa1232edc2054646054c2768e5af272c /t/t3404-rebase-interactive.sh
parent6c4c44c45881260877d7d9fd113fd75b74d7777c (diff)
downloadgit-6bdcd0d2fcca7c3985a078c8d343a863136fb675.zip
git-6bdcd0d2fcca7c3985a078c8d343a863136fb675.tar.gz
git-6bdcd0d2fcca7c3985a078c8d343a863136fb675.tar.bz2
rebase -i: Retain user-edited commit messages after squash/fixup conflicts
When a squash/fixup fails due to a conflict, the user is required to edit the commit message. Previously, if further squash/fixup commands followed the conflicting squash/fixup, this user-edited message was discarded and a new automatically-generated commit message was suggested. Change the handling of conflicts within squash/fixup command series: Whenever the user is required to intervene, consider the resulting commit to be a new basis for the following squash/fixups and use its commit message in later suggested combined commit messages. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3404-rebase-interactive.sh')
-rwxr-xr-xt/t3404-rebase-interactive.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index a119ce0..4e35137 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -264,6 +264,42 @@ test_expect_success 'multi-fixup does not fire up editor' '
git branch -D multi-fixup
'
+test_expect_success 'commit message used after conflict' '
+ git checkout -b conflict-fixup conflict-branch &&
+ base=$(git rev-parse HEAD~4) &&
+ (
+ FAKE_LINES="1 fixup 3 fixup 4" &&
+ export FAKE_LINES &&
+ test_must_fail git rebase -i $base
+ ) &&
+ echo three > conflict &&
+ git add conflict &&
+ FAKE_COMMIT_AMEND="ONCE" EXPECT_HEADER_COUNT=2 \
+ git rebase --continue &&
+ test $base = $(git rev-parse HEAD^) &&
+ test 1 = $(git show | grep ONCE | wc -l) &&
+ git checkout to-be-rebased &&
+ git branch -D conflict-fixup
+'
+
+test_expect_success 'commit message retained after conflict' '
+ git checkout -b conflict-squash conflict-branch &&
+ base=$(git rev-parse HEAD~4) &&
+ (
+ FAKE_LINES="1 fixup 3 squash 4" &&
+ export FAKE_LINES &&
+ test_must_fail git rebase -i $base
+ ) &&
+ echo three > conflict &&
+ git add conflict &&
+ FAKE_COMMIT_AMEND="TWICE" EXPECT_HEADER_COUNT=2 \
+ git rebase --continue &&
+ test $base = $(git rev-parse HEAD^) &&
+ test 2 = $(git show | grep TWICE | wc -l) &&
+ git checkout to-be-rebased &&
+ git branch -D conflict-squash
+'
+
cat > expect-squash-fixup << EOF
B