]> git.ipfire.org Git - thirdparty/git.git/commitdiff
pull: trivial cleanup
authorFelipe Contreras <felipe.contreras@gmail.com>
Thu, 17 Jun 2021 16:17:09 +0000 (11:17 -0500)
committerJunio C Hamano <gitster@pobox.com>
Sat, 19 Jun 2021 07:36:17 +0000 (16:36 +0900)
There's no need to store ran_ff. Now it's obvious from the conditionals.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/pull.c

index a22293b7dba0e488c7fbeb35f84e09da69f8376c..80e2f55cbcc6a534befd5963f9a123446829b73b 100644 (file)
@@ -1053,7 +1053,6 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
 
        if (opt_rebase) {
                int ret = 0;
-               int ran_ff = 0;
 
                struct object_id newbase;
                struct object_id upstream;
@@ -1068,11 +1067,10 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
                if (can_ff) {
                        /* we can fast-forward this without invoking rebase */
                        opt_ff = "--ff-only";
-                       ran_ff = 1;
                        ret = run_merge();
-               }
-               if (!ran_ff)
+               } else {
                        ret = run_rebase(&newbase, &upstream);
+               }
 
                if (!ret && (recurse_submodules == RECURSE_SUBMODULES_ON ||
                             recurse_submodules == RECURSE_SUBMODULES_ON_DEMAND))