From: Alexander Kuleshov Date: Mon, 2 Mar 2015 12:02:37 +0000 (+0600) Subject: git: make was_alias and done_help non-static X-Git-Tag: v2.3.4~3^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8fa7975b076ae039f63286601f48e64115e2aba7;p=git git: make was_alias and done_help non-static '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 Helped-by: Eric Sunshine Helped-by: Jeff King Signed-off-by: Junio C Hamano --- diff --git a/git.c b/git.c index 6b5ae6a2ac..29268d2f8e 100644 --- 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) {