mirror of
https://github.com/git/git
synced 2024-10-03 23:29:36 +00:00
cherry-pick: enforce --keep-redundant-commits
incompatibility
When `--keep-redundant-commits` was added in b27cfb0d8d
(git-cherry-pick: Add keep-redundant-commits option, 2012-04-20), it was
not marked as incompatible with the various operations needed to
continue or exit a cherry-pick (`--continue`, `--skip`, `--abort`, and
`--quit`).
Enforce this incompatibility via `verify_opt_compatible` like we do for
the other various options.
Signed-off-by: Brian Lyles <brianmlyles@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
661b671aec
commit
bd2f9fd025
|
@ -167,6 +167,7 @@ static int run_sequencer(int argc, const char **argv, const char *prefix,
|
|||
"--ff", opts->allow_ff,
|
||||
"--rerere-autoupdate", opts->allow_rerere_auto == RERERE_AUTOUPDATE,
|
||||
"--no-rerere-autoupdate", opts->allow_rerere_auto == RERERE_NOAUTOUPDATE,
|
||||
"--keep-redundant-commits", opts->keep_redundant_commits,
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -99,4 +99,18 @@ test_expect_success 'cherry-pick a no-op with --keep-redundant' '
|
|||
test_cmp expect actual
|
||||
'
|
||||
|
||||
test_expect_success '--keep-redundant-commits is incompatible with operations' '
|
||||
test_must_fail git cherry-pick HEAD 2>output &&
|
||||
test_grep "The previous cherry-pick is now empty" output &&
|
||||
test_must_fail git cherry-pick --keep-redundant-commits --continue 2>output &&
|
||||
test_grep "fatal: cherry-pick: --keep-redundant-commits cannot be used with --continue" output &&
|
||||
test_must_fail git cherry-pick --keep-redundant-commits --skip 2>output &&
|
||||
test_grep "fatal: cherry-pick: --keep-redundant-commits cannot be used with --skip" output &&
|
||||
test_must_fail git cherry-pick --keep-redundant-commits --abort 2>output &&
|
||||
test_grep "fatal: cherry-pick: --keep-redundant-commits cannot be used with --abort" output &&
|
||||
test_must_fail git cherry-pick --keep-redundant-commits --quit 2>output &&
|
||||
test_grep "fatal: cherry-pick: --keep-redundant-commits cannot be used with --quit" output &&
|
||||
git cherry-pick --abort
|
||||
'
|
||||
|
||||
test_done
|
||||
|
|
Loading…
Reference in a new issue