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:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2019-07-31 18:18:47 +0300
committerJunio C Hamano <gitster@pobox.com>2019-07-31 22:24:07 +0300
commite145d993478befd0db6999822aa31d422b283a3b (patch)
treeadf27954b5199a27cef653ba7fa2f7d5f5baa508 /t/t3430-rebase-merges.sh
parent4e6023b13ae1159277a7c3053f8d074c23456812 (diff)
rebase -r: support merge strategies other than `recursive`
We already support merge strategies in the sequencer, but only for `pick` commands. With this commit, we now also support them in `merge` commands. The approach is simple: if any merge strategy option is specified, or if any merge strategy other than `recursive` is specified, we simply spawn the `git merge` command. Otherwise, we handle the merge in-process just as before. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3430-rebase-merges.sh')
-rwxr-xr-xt/t3430-rebase-merges.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh
index 42ba5b9f09..8ea6ff3548 100755
--- a/t/t3430-rebase-merges.sh
+++ b/t/t3430-rebase-merges.sh
@@ -412,4 +412,25 @@ test_expect_success '--continue after resolving conflicts after a merge' '
test_path_is_missing .git/MERGE_HEAD
'
+test_expect_success '--rebase-merges with strategies' '
+ git checkout -b with-a-strategy F &&
+ test_tick &&
+ git merge -m "Merge conflicting-G" conflicting-G &&
+
+ : first, test with a merge strategy option &&
+ git rebase -ir -Xtheirs G &&
+ echo conflicting-G >expect &&
+ test_cmp expect G.t &&
+
+ : now, try with a merge strategy other than recursive &&
+ git reset --hard @{1} &&
+ write_script git-merge-override <<-\EOF &&
+ echo overridden$1 >>G.t
+ git add G.t
+ EOF
+ PATH="$PWD:$PATH" git rebase -ir -s override -Xxopt G &&
+ test_write_lines G overridden--xopt >expect &&
+ test_cmp expect G.t
+'
+
test_done