Skip to content

Commit

Permalink
git: make was_alias and done_help non-static
Browse files Browse the repository at this point in the history
'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>
  • Loading branch information
Alexander Kuleshov authored and Junio C Hamano committed Mar 6, 2015
1 parent 9874fca commit 8fa7975
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions git.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 8fa7975

Please sign in to comment.