Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharvi Mendiratta <charvi077@gmail.com>2021-01-29 21:20:49 +0300
committerJunio C Hamano <gitster@pobox.com>2021-01-30 02:21:56 +0300
commitbae5b4aea523388faedd3b850c862fe45198c6b2 (patch)
tree4a8ce59e854fa06df5a17c5f69f3493643673b10 /t/t3437-rebase-fixup-options.sh
parent1d410cd8c25978c1591a7d35c9077745146c6129 (diff)
rebase -i: teach --autosquash to work with amend!
If the commit subject starts with "amend!" then rearrange it like a "fixup!" commit and replace `pick` command with `fixup -C` command, which is used to fixup up the content if any and replaces the original commit message with amend! commit's message. Original-patch-by: Phillip Wood <phillip.wood@dunelm.org.uk> Mentored-by: Christian Couder <chriscool@tuxfamily.org> Mentored-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Charvi Mendiratta <charvi077@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3437-rebase-fixup-options.sh')
-rwxr-xr-xt/t3437-rebase-fixup-options.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t3437-rebase-fixup-options.sh b/t/t3437-rebase-fixup-options.sh
index 832971ffdb..945df2555b 100755
--- a/t/t3437-rebase-fixup-options.sh
+++ b/t/t3437-rebase-fixup-options.sh
@@ -210,4 +210,16 @@ test_expect_success 'sequence squash, fixup & fixup -c gives combined message' '
test_cmp_rev HEAD^ A
'
+test_expect_success 'fixup -C works upon --autosquash with amend!' '
+ git checkout --detach branch &&
+ FAKE_COMMIT_AMEND=squashed \
+ FAKE_MESSAGE_COPY=actual-squash-message \
+ git -c commit.status=false rebase -ik --autosquash \
+ --signoff A &&
+ git diff-tree --exit-code --patch HEAD branch -- &&
+ test_cmp_rev HEAD^ A &&
+ test_i18ncmp "$TEST_DIRECTORY/t3437/expected-squash-message" \
+ actual-squash-message
+'
+
test_done