]> git.ipfire.org Git - thirdparty/git.git/commitdiff
rebase: move incompatibility checks between backend options a bit earlier
authorElijah Newren <newren@gmail.com>
Sat, 15 Feb 2020 21:36:33 +0000 (21:36 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 16 Feb 2020 23:40:42 +0000 (15:40 -0800)
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/rebase.c

index 6e9a2fedc7faae9f285fd8e534b07962ff192142..a2f05f783d813319078f632b932e5460ecfcf2b9 100644 (file)
@@ -1878,6 +1878,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:
@@ -1908,17 +1919,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 "