]> git.ipfire.org Git - thirdparty/git.git/commitdiff
rebase: handle --strategy via imply_merge() as well
authorOswald Buddenhagen <oswald.buddenhagen@gmx.de>
Fri, 20 Oct 2023 09:36:53 +0000 (11:36 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 20 Oct 2023 21:47:44 +0000 (14:47 -0700)
At least after the successive trimming of enum rebase_type mentioned in
the previous commit, this code did exactly what imply_merge() does, so
just call it instead.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/rebase.c

index 41853a0b10e4029babb8fb9f7cf46bab894db807..ae360b576a10daebb58073ff040c2ad91057ac4d 100644 (file)
@@ -1490,18 +1490,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
 
        if (options.strategy) {
                options.strategy = xstrdup(options.strategy);
-               switch (options.type) {
-               case REBASE_APPLY:
-                       die(_("--strategy requires --merge or --interactive"));
-               case REBASE_MERGE:
-                       /* compatible */
-                       break;
-               case REBASE_UNSPECIFIED:
-                       options.type = REBASE_MERGE;
-                       break;
-               default:
-                       BUG("unhandled rebase type (%d)", options.type);
-               }
+               imply_merge(&options, "--strategy");
        }
 
        if (options.root && !options.onto_name)