]> granicus.if.org Git - git/commitdiff
git: make was_alias and done_help non-static
authorAlexander Kuleshov <kuleshovmail@gmail.com>
Mon, 2 Mar 2015 12:02:37 +0000 (18:02 +0600)
committerJunio C Hamano <gitster@pobox.com>
Fri, 6 Mar 2015 20:03:30 +0000 (12:03 -0800)
'was_alias' variable does not need to store it's value on each
iteration in the loop; this variable gets assigned the result
of run_argv() every time in the loop before being used.

'done_help' variable does not need to be static variable too if
we move it out the loop.

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git.c

diff --git a/git.c b/git.c
index 6b5ae6a2ace7fffdd2ec50ce915ad5dc01a9c7da..29268d2f8e528a49db89f880c2ce7dab4f6d4b71 100644 (file)
--- a/git.c
+++ b/git.c
@@ -618,6 +618,7 @@ int main(int argc, char **av)
 {
        const char **argv = (const char **) av;
        const char *cmd;
+       int done_help = 0;
 
        startup_info = &git_startup_info;
 
@@ -680,9 +681,7 @@ int main(int argc, char **av)
        setup_path();
 
        while (1) {
-               static int done_help = 0;
-               static int was_alias = 0;
-               was_alias = run_argv(&argc, &argv);
+               int was_alias = run_argv(&argc, &argv);
                if (errno != ENOENT)
                        break;
                if (was_alias) {