Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-03-17 21:08:34 +0300
committerJunio C Hamano <gitster@pobox.com>2022-03-18 04:03:11 +0300
commit5f9b64a6c26552af2c3c57ea37f308537dc5bee9 (patch)
tree13a8e46c1a37d74ee05cd6feaf42f0c27620986f /builtin/reflog.c
parent03df6cb833a21e924b02af58df76d93a8e0d9648 (diff)
reflog: refactor cmd_reflog() to "if" branches
Refactor the "if" branches in cmd_reflog() to use "else if" instead, and remove the whitespace between them. As with 92f480909f7 (multi-pack-index: refactor "goto usage" pattern, 2021-08-23) this makes this code more consistent with how builtin/{bundle,stash,commit-graph,multi-pack-index}.c look and behave. Their top-level commands are all similar sub-command routing functions. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/reflog.c')
-rw-r--r--builtin/reflog.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/builtin/reflog.c b/builtin/reflog.c
index 9407f835cb..c864f27630 100644
--- a/builtin/reflog.c
+++ b/builtin/reflog.c
@@ -384,14 +384,11 @@ int cmd_reflog(int argc, const char **argv, const char *prefix)
if (!strcmp(argv[1], "show"))
return cmd_log_reflog(argc - 1, argv + 1, prefix);
-
- if (!strcmp(argv[1], "expire"))
+ else if (!strcmp(argv[1], "expire"))
return cmd_reflog_expire(argc - 1, argv + 1, prefix);
-
- if (!strcmp(argv[1], "delete"))
+ else if (!strcmp(argv[1], "delete"))
return cmd_reflog_delete(argc - 1, argv + 1, prefix);
-
- if (!strcmp(argv[1], "exists"))
+ else if (!strcmp(argv[1], "exists"))
return cmd_reflog_exists(argc - 1, argv + 1, prefix);
return cmd_log_reflog(argc, argv, prefix);