t3418: add testcase showing problems with rebase -i and strategy options

We are not passing the same args to merge strategies when we are doing an --interactive rebase as we do with a --merge rebase. The merge strategy should not need to be aware of which type of rebase is in effect. Add a testcase which checks for the appropriate args. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elijah Newren committed Jun 27, 2018 at 08:48 UTC a5a959d9a8481f46f89be437d7b336c70b473d9b
1 file changed +32
t/t3418-rebase-continue.sh
+32
@@ -74,6 +74,38 @@ test_expect_success 'rebase --continue remembers merge strategy and options' '
74 test -f funny.was.run
75 '
76
77 +test_expect_failure 'rebase -i --continue handles merge strategy and options' '
78 + rm -fr .git/rebase-* &&
79 + git reset --hard commit-new-file-F2-on-topic-branch &&
80 + test_commit "commit-new-file-F3-on-topic-branch-for-dash-i" F3 32 &&
81 + test_when_finished "rm -fr test-bin funny.was.run funny.args" &&
82 + mkdir test-bin &&
83 + cat >test-bin/git-merge-funny <<-EOF &&
84 + #!$SHELL_PATH
85 + echo "\$@" >>funny.args
86 + case "\$1" in --opt) ;; *) exit 2 ;; esac
87 + case "\$2" in --foo) ;; *) exit 2 ;; esac
88 + case "\$4" in --) ;; *) exit 2 ;; esac
89 + shift 2 &&
90 + >funny.was.run &&
91 + exec git merge-recursive "\$@"
92 + EOF
93 + chmod +x test-bin/git-merge-funny &&
94 + (
95 + PATH=./test-bin:$PATH &&
96 + test_must_fail git rebase -i -s funny -Xopt -Xfoo master topic
97 + ) &&
98 + test -f funny.was.run &&
99 + rm funny.was.run &&
100 + echo "Resolved" >F2 &&
101 + git add F2 &&
102 + (
103 + PATH=./test-bin:$PATH &&
104 + git rebase --continue
105 + ) &&
106 + test -f funny.was.run
107 +'
108 +
109 test_expect_success 'rebase passes merge strategy options correctly' '
110 rm -fr .git/rebase-* &&
111 git reset --hard commit-new-file-F3-on-topic-branch &&