]> git.ipfire.org Git - thirdparty/git.git/commitdiff
rebase: simplify an assignment of options.type in cmd_rebase
authorEdmundo Carmona Antoranz <eantoranz@gmail.com>
Mon, 18 Apr 2022 17:27:21 +0000 (19:27 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 20 Apr 2022 19:42:05 +0000 (12:42 -0700)
There is an if statement where both if and else have the same
assignment of options.type to REBASE_MERGE. Simplify
it by getting that assigmnent out of the if.

Signed-off-by: Edmundo Carmona Antoranz <eantoranz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/rebase.c

index 36490d06c8ac6ad4c10596b7e2a4556ec7aaa8c8..81c8926a56691a252f708a8553304215178ee0ef 100644 (file)
@@ -1159,11 +1159,9 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
                } else {
                        strbuf_reset(&buf);
                        strbuf_addf(&buf, "%s/interactive", merge_dir());
-                       if(file_exists(buf.buf)) {
-                               options.type = REBASE_MERGE;
+                       options.type = REBASE_MERGE;
+                       if (file_exists(buf.buf))
                                options.flags |= REBASE_INTERACTIVE_EXPLICIT;
-                       } else
-                               options.type = REBASE_MERGE;
                }
                options.state_dir = merge_dir();
        }