summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@gmx.de>2023-10-20 11:36:53 +0200
committerJunio C Hamano <gitster@pobox.com>2023-10-20 14:47:44 -0700
commit37e80a24716affc5698822393ad9e09646d0be73 (patch)
tree0c830f81aaedbb9ff00be0d74e95c2f5e4c0b7ce
parenta5b5740bf63cd435fb172b12aa97176f13ff3fd3 (diff)
downloadgit-37e80a24716affc5698822393ad9e09646d0be73.tar.gz
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>
-rw-r--r--builtin/rebase.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 41853a0b10..ae360b576a 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -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)