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:
authorPhillip Wood <phillip.wood@dunelm.org.uk>2023-04-10 12:08:29 +0300
committerJunio C Hamano <gitster@pobox.com>2023-04-10 19:53:19 +0300
commit4a8bc9860aa09942dd0e6540d53102219a7e920d (patch)
tree98ad5eed7df31536638880e7088d1c5381a60d98 /t/t3436-rebase-more-options.sh
parentfb60b9f37f87241a886e183f0ec6261debb9c1c5 (diff)
rebase -m: cleanup --strategy-option handling
When handling "--strategy-option" rebase collects the commands into a struct string_list, then concatenates them into a string, prepending "--" to each one before splitting the string and removing the "--" prefix. This is an artifact of the scripted rebase and the need to support "rebase --preserve-merges". Now that "--preserve-merges" no-longer exists we can cleanup the way the argument is handled. The tests for a bad strategy option are adjusted now that parse_strategy_opts() is no-longer called when starting a rebase. The fact that it only errors out when running "git rebase --continue" is a mixed blessing but the next commit will fix the root cause of the parsing problem so lets not worry about that here. Reviewed-by: Elijah Newren <newren@gmail.com> Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3436-rebase-more-options.sh')
-rwxr-xr-xt/t3436-rebase-more-options.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/t/t3436-rebase-more-options.sh b/t/t3436-rebase-more-options.sh
index c3184c9ade..3adf42f47d 100755
--- a/t/t3436-rebase-more-options.sh
+++ b/t/t3436-rebase-more-options.sh
@@ -41,19 +41,25 @@ test_expect_success 'setup' '
'
test_expect_success 'bad -X <strategy-option> arguments: unclosed quote' '
+ test_when_finished "test_might_fail git rebase --abort" &&
cat >expect <<-\EOF &&
fatal: could not split '\''--bad'\'': unclosed quote
EOF
- test_expect_code 128 git rebase -X"bad argument\"" side main >out 2>actual &&
+ GIT_SEQUENCE_EDITOR="echo break >" \
+ git rebase -i -X"bad argument\"" side main &&
+ test_expect_code 128 git rebase --continue >out 2>actual &&
test_must_be_empty out &&
test_cmp expect actual
'
test_expect_success 'bad -X <strategy-option> arguments: bad escape' '
+ test_when_finished "test_might_fail git rebase --abort" &&
cat >expect <<-\EOF &&
fatal: could not split '\''--bad'\'': cmdline ends with \
EOF
- test_expect_code 128 git rebase -X"bad escape \\" side main >out 2>actual &&
+ GIT_SEQUENCE_EDITOR="echo break >" \
+ git rebase -i -X"bad escape \\" side main &&
+ test_expect_code 128 git rebase --continue >out 2>actual &&
test_must_be_empty out &&
test_cmp expect actual
'