builtin/checkout.c: use "ret" variable for return
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 5 Jun 2018 14:40:47 +0000 (14:40 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 11 Jun 2018 16:41:01 +0000 (09:41 -0700)
There is no point in doing this right now, but in later change the
"ret" variable will be inspected. This change makes that meaningful
change smaller.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/checkout.c
index 72457fb7d53bc869c92631d8ad5c31604d37a919..8c93c55cbc2a2f09954f3574712a85749c3ec61b 100644 (file)
@@ -1265,8 +1265,10 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
        }
 
        UNLEAK(opts);
-       if (opts.patch_mode || opts.pathspec.nr)
-               return checkout_paths(&opts, new_branch_info.name);
-       else
+       if (opts.patch_mode || opts.pathspec.nr) {
+               int ret = checkout_paths(&opts, new_branch_info.name);
+               return ret;
+       } else {
                return checkout_branch(&opts, &new_branch_info);
+       }
 }