Skip to content

Commit 8af14f0

Browse files
newrengitster
authored andcommitted
rebase: move incompatibility checks between backend options a bit earlier
Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent be50c93 commit 8af14f0

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

builtin/rebase.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)