Skip to content

Commit a5b5740

Browse files
ossilatorgitster
authored andcommitted
rebase: simplify code related to imply_merge()
The code's evolution left in some bits surrounding enum rebase_type that don't really make sense any more. In particular, it makes no sense to invoke imply_merge() if the type is already known not to be REBASE_APPLY, and it makes no sense to assign the type after calling imply_merge(). enum rebase_type had more values until commit a74b350 ("rebase: drop support for `--preserve-merges`") and commit 10cdb9f ("rebase: rename the two primary rebase backends"). The latter commit also renamed imply_interactive() to imply_merge(). Signed-off-by: Oswald Buddenhagen <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 813d9a9 commit a5b5740

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

builtin/rebase.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,6 @@ static int parse_opt_keep_empty(const struct option *opt, const char *arg,
386386

387387
imply_merge(opts, unset ? "--no-keep-empty" : "--keep-empty");
388388
opts->keep_empty = !unset;
389-
opts->type = REBASE_MERGE;
390389
return 0;
391390
}
392391

@@ -1505,9 +1504,6 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
15051504
}
15061505
}
15071506

1508-
if (options.type == REBASE_MERGE)
1509-
imply_merge(&options, "--merge");
1510-
15111507
if (options.root && !options.onto_name)
15121508
imply_merge(&options, "--root without --onto");
15131509

@@ -1552,7 +1548,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
15521548

15531549
if (options.type == REBASE_UNSPECIFIED) {
15541550
if (!strcmp(options.default_backend, "merge"))
1555-
imply_merge(&options, "--merge");
1551+
options.type = REBASE_MERGE;
15561552
else if (!strcmp(options.default_backend, "apply"))
15571553
options.type = REBASE_APPLY;
15581554
else

0 commit comments

Comments
 (0)