rebase: handle --strategy via imply_merge() as well

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>

Oswald Buddenhagen committed Oct 20, 2023 at 11:36 UTC 37e80a24716affc5698822393ad9e09646d0be73
1 file changed +1 -12
builtin/rebase.c
+1 -12
@@ -1490,18 +1490,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
1490
1491 if (options.strategy) {
1492 options.strategy = xstrdup(options.strategy);
1493 - switch (options.type) {
1494 - case REBASE_APPLY:
1495 - die(_("--strategy requires --merge or --interactive"));
1496 - case REBASE_MERGE:
1497 - /* compatible */
1498 - break;
1499 - case REBASE_UNSPECIFIED:
1500 - options.type = REBASE_MERGE;
1501 - break;
1502 - default:
1503 - BUG("unhandled rebase type (%d)", options.type);
1504 - }
1493 + imply_merge(&options, "--strategy");
1494 }
1495
1496 if (options.root && !options.onto_name)