aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/replay.c
diff options
context:
space:
mode:
authorToon Claes <toon@iotcl.com>2025-02-06 07:33:34 +0100
committerJunio C Hamano <gitster@pobox.com>2025-02-06 12:23:54 -0800
commit9144b9362b2ed972f5886dcc7beee6a2acce2708 (patch)
tree843fbc779c26450b5299dade9feafbd4e13f09a1 /builtin/replay.c
parentclone: introduce struct clone_opts in builtin/clone.c (diff)
downloadgit-9144b9362b2ed972f5886dcc7beee6a2acce2708.tar.gz
git-9144b9362b2ed972f5886dcc7beee6a2acce2708.zip
parse-options: introduce die_for_incompatible_opt2()
The functions die_for_incompatible_opt3() and die_for_incompatible_opt4() already exist to die whenever a user specifies three or four options respectively that are not compatible. Introduce die_for_incompatible_opt2() which dies when two options that are incompatible are set. Signed-off-by: Toon Claes <toon@iotcl.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/replay.c')
-rw-r--r--builtin/replay.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/builtin/replay.c b/builtin/replay.c
index 1afc6d1ee0..032c172b65 100644
--- a/builtin/replay.c
+++ b/builtin/replay.c
@@ -163,9 +163,10 @@ static void determine_replay_mode(struct rev_cmdline_info *cmd_info,
get_ref_information(cmd_info, &rinfo);
if (!rinfo.positive_refexprs)
die(_("need some commits to replay"));
- if (onto_name && *advance_name)
- die(_("--onto and --advance are incompatible"));
- else if (onto_name) {
+
+ die_for_incompatible_opt2(!!onto_name, "--onto",
+ !!*advance_name, "--advance");
+ if (onto_name) {
*onto = peel_committish(onto_name);
if (rinfo.positive_refexprs <
strset_get_size(&rinfo.positive_refs))