1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-09 04:26:08 +02:00

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 <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>
This commit is contained in:
Alexander Kuleshov 2015-03-02 18:02:37 +06:00 committed by Junio C Hamano
parent 9874fca712
commit 8fa7975b07

5
git.c
View File

@ -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) {