summaryrefslogtreecommitdiff
path: root/t/t3430-rebase-merges.sh
diff options
context:
space:
mode:
authorLibravatar Jiang Xin <worldhello.net@gmail.com>2021-10-30 09:34:30 +0800
committerLibravatar Jiang Xin <worldhello.net@gmail.com>2021-10-30 09:34:30 +0800
commitcd9ef9ce67bf2934845a6a76a1ecdbc9a5f7a6e0 (patch)
treeba34cf45622ddcd8e9d250a048661a7e6a8a35ee /t/t3430-rebase-merges.sh
parentMerge branch 'master' of github.com:nafmo/git-l10n-sv (diff)
parentGit 2.34-rc0 (diff)
downloadtgif-cd9ef9ce67bf2934845a6a76a1ecdbc9a5f7a6e0.tar.xz
Merge branch 'master' of github.com:git/git
* 'master' of github.com:git/git: (762 commits) Git 2.34-rc0 wrapper: remove xunsetenv() log: document --encoding behavior on iconv() failure Revert "logmsg_reencode(): warn when iconv() fails" completion: fix incorrect bash/zsh string equality check add, rm, mv: fix bug that prevents the update of non-sparse dirs git-bundle.txt: add missing words and punctuation Documentation/Makefile: fix lint-docs mkdir dependency submodule: drop unused sm_name parameter from append_fetch_remotes() The fifteenth batch gitweb.txt: change "folder" to "directory" gitignore.txt: change "folder" to "directory" git-multi-pack-index.txt: change "folder" to "directory" git.txt: fix typo archive: describe compression level option config.txt: fix typo command-list.txt: remove 'sparse-index' from main help userdiff-cpp: back out the digit-separators in numbers submodule--helper: fix incorrect newlines in an error message branch (doc): -m/-c copies config and reflog ...
Diffstat (limited to 't/t3430-rebase-merges.sh')
-rwxr-xr-xt/t3430-rebase-merges.sh38
1 files changed, 29 insertions, 9 deletions
diff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh
index 6748070df5..43c82d9a33 100755
--- a/t/t3430-rebase-merges.sh
+++ b/t/t3430-rebase-merges.sh
@@ -172,19 +172,39 @@ test_expect_success 'failed `merge <branch>` does not crash' '
grep "^Merge branch ${SQ}G${SQ}$" .git/rebase-merge/message
'
-test_expect_success 'fast-forward merge -c still rewords' '
- git checkout -b fast-forward-merge-c H &&
+test_expect_success 'merge -c commits before rewording and reloads todo-list' '
+ cat >script-from-scratch <<-\EOF &&
+ merge -c E B
+ merge -c H G
+ EOF
+
+ git checkout -b merge-c H &&
(
- set_fake_editor &&
- FAKE_COMMIT_MESSAGE=edited \
- GIT_SEQUENCE_EDITOR="echo merge -c H G >" \
- git rebase -ir @^
+ set_reword_editor &&
+ GIT_SEQUENCE_EDITOR="\"$PWD/replace-editor.sh\"" \
+ git rebase -i -r D
) &&
- echo edited >expected &&
- git log --pretty=format:%B -1 >actual &&
- test_cmp expected actual
+ check_reworded_commits E H
'
+test_expect_success 'merge -c rewords when a strategy is given' '
+ git checkout -b merge-c-with-strategy H &&
+ write_script git-merge-override <<-\EOF &&
+ echo overridden$1 >G.t
+ git add G.t
+ EOF
+
+ PATH="$PWD:$PATH" \
+ GIT_SEQUENCE_EDITOR="echo merge -c H G >" \
+ GIT_EDITOR="echo edited >>" \
+ git rebase --no-ff -ir -s override -Xxopt E &&
+ test_write_lines overridden--xopt >expect &&
+ test_cmp expect G.t &&
+ test_write_lines H "" edited "" >expect &&
+ git log --format=%B -1 >actual &&
+ test_cmp expect actual
+
+'
test_expect_success 'with a branch tip that was cherry-picked already' '
git checkout -b already-upstream main &&
base="$(git rev-parse --verify HEAD)" &&