Skip to content

Commit a5a959d

Browse files
newrengitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fc54c1a commit a5a959d

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

t/t3418-rebase-continue.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,38 @@ test_expect_success 'rebase --continue remembers merge strategy and options' '
7474
test -f funny.was.run
7575
'
7676

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+
77109
test_expect_success 'rebase passes merge strategy options correctly' '
78110
rm -fr .git/rebase-* &&
79111
git reset --hard commit-new-file-F3-on-topic-branch &&

0 commit comments

Comments
 (0)