summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2020-02-15 21:36:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-02-16 23:40:42 (GMT)
commit8af14f08596197d53c40b71ed014b030956a12be (patch)
tree44513f54c91077fecec68c16317e1eb7b69cffaf /builtin
parentbe50c938dfc1555ea62df455a41138e41503b952 (diff)
downloadgit-8af14f08596197d53c40b71ed014b030956a12be.zip
git-8af14f08596197d53c40b71ed014b030956a12be.tar.gz
git-8af14f08596197d53c40b71ed014b030956a12be.tar.bz2
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>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/rebase.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 6e9a2fe..a2f05f7 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -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 "