@@ -1878,6 +1878,17 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
18781878 if (isatty (2 ) && options .flags & REBASE_NO_QUIET )
18791879 strbuf_addstr (& options .git_format_patch_opt , " --progress" );
18801880
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+
18811892 switch (options .type ) {
18821893 case REBASE_MERGE :
18831894 case REBASE_INTERACTIVE :
@@ -1908,17 +1919,6 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
19081919 if (reschedule_failed_exec >= 0 )
19091920 options .reschedule_failed_exec = reschedule_failed_exec ;
19101921
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-
19221922 if (options .signoff ) {
19231923 if (options .type == REBASE_PRESERVE_MERGES )
19241924 die ("cannot combine '--signoff' with "
0 commit comments