rebase: move incompatibility checks between backend options a bit earlier
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elijah Newren committed
Feb 15, 2020 at 21:36 UTC
8af14f08596197d53c40b71ed014b030956a12be
1 file changed
+11
-11
builtin/rebase.c
+11
-11
@@ -1878,6 +1878,17 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
1878
if (isatty(2) && options.flags & REBASE_NO_QUIET)
1879
strbuf_addstr(&options.git_format_patch_opt, " --progress");
1880
1881
+ if (options.git_am_opts.argc) {
1882
+ /* all am options except -q are compatible only with --am */
1883
+ for (i = options.git_am_opts.argc - 1; i >= 0; i--)
1884
+ if (strcmp(options.git_am_opts.argv[i], "-q"))
1885
+ break;
1886
+
1887
+ if (is_interactive(&options) && i >= 0)
1888
+ die(_("cannot combine am options with either "
1889
+ "interactive or merge options"));
1890
+ }
1891
+
1892
switch (options.type) {
1893
case REBASE_MERGE:
1894
case REBASE_INTERACTIVE:
@@ -1908,17 +1919,6 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
1919
if (reschedule_failed_exec >= 0)
1920
options.reschedule_failed_exec = reschedule_failed_exec;
1921
1911
- if (options.git_am_opts.argc) {
1912
- /* all am options except -q are compatible only with --am */
1913
- for (i = options.git_am_opts.argc - 1; i >= 0; i--)
1914
- if (strcmp(options.git_am_opts.argv[i], "-q"))
1915
- break;
1916
-
1917
- if (is_interactive(&options) && i >= 0)
1918
- die(_("cannot combine am options with either "
1919
- "interactive or merge options"));
1920
- }
1921
-
1922
if (options.signoff) {
1923
if (options.type == REBASE_PRESERVE_MERGES)
1924
die("cannot combine '--signoff' with "