From: Elijah Newren via GitGitGadget Date: Tue, 24 Dec 2019 19:54:53 GMT Subject: [PATCH v3 09/15] rebase: move incompatibility checks between backend options a bit earlier Message-ID: <7c3f2e07f3d388730f2a2ba48c70ad1590a91d99.1577217299.git.gitgitgadget@gmail.com> In-Reply-To: From: Elijah Newren Signed-off-by: Elijah Newren --- builtin/rebase.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/builtin/rebase.c b/builtin/rebase.c index 7027e34567..d2b99e9908 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -1906,6 +1906,17 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) if (isatty(2) && options.flags & REBASE_NO_QUIET) strbuf_addstr(&options.git_format_patch_opt, " --progress"); + if (options.git_am_opts.argc) { + /* all am options except -q are compatible only with --am */ + for (i = options.git_am_opts.argc - 1; i >= 0; i--) + if (strcmp(options.git_am_opts.argv[i], "-q")) + break; + + if (is_interactive(&options) && i >= 0) + die(_("cannot combine am options with either " + "interactive or merge options")); + } + switch (options.type) { case REBASE_MERGE: case REBASE_INTERACTIVE: @@ -1936,17 +1947,6 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) if (reschedule_failed_exec >= 0) options.reschedule_failed_exec = reschedule_failed_exec; - if (options.git_am_opts.argc) { - /* all am options except -q are compatible only with --am */ - for (i = options.git_am_opts.argc - 1; i >= 0; i--) - if (strcmp(options.git_am_opts.argv[i], "-q")) - break; - - if (is_interactive(&options) && i >= 0) - die(_("cannot combine am options with either " - "interactive or merge options")); - } - if (options.signoff) { if (options.type == REBASE_PRESERVE_MERGES) die("cannot combine '--signoff' with " -- gitgitgadget