]> granicus.if.org Git - git/commit
Fix use of strategy options with interactive rebases
authorElijah Newren <newren@gmail.com>
Wed, 27 Jun 2018 15:48:04 +0000 (08:48 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 Jun 2018 19:25:12 +0000 (12:25 -0700)
commit0060041df1b0873b36aacfae8e579999bcc27f39
treea17188b62c451d4311b5a71f2886e8169d715dc1
parenta5a959d9a8481f46f89be437d7b336c70b473d9b
Fix use of strategy options with interactive rebases

git-rebase.sh wrote strategy options to .git/rebase/merge/strategy_opts
in the following format:
  '--ours'  '--renormalize'
Note the double spaces.

git-rebase--interactive uses sequencer.c to parse that file, and
sequencer.c used split_cmdline() to get the individual strategy options.
After splitting, sequencer.c prefixed each "option" with a double dash,
so, concatenating all its options would result in:
  -- --ours -- --renormalize

So, when it ended up calling try_merge_strategy(), that in turn would run
  git merge-$strategy -- --ours -- --renormalize $merge_base -- $head $remote

instead of the expected/desired
  git merge-$strategy --ours --renormalize $merge_base -- $head $remote

Remove the extra spaces so that when it goes through split_cmdline() we end
up with the desired command line.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-rebase.sh
sequencer.c
t/t3418-rebase-continue.sh