diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-02-27 14:01:30 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-02-27 14:01:30 -0800 |
commit | 043478308feec3cda9b3473bc0b79396cb9d4db6 (patch) | |
tree | 59e92b4034e40876a6abfaccdef9a121679d51e8 /builtin/fetch.c | |
parent | a06f23c7393d187be3ded662102ec2b7b1b28bd0 (diff) | |
parent | 4f1c0b21e9045ff12e1880b5724a032031716a24 (diff) | |
download | git-043478308feec3cda9b3473bc0b79396cb9d4db6.tar.gz |
Merge branch 'ep/varscope'
Shrink lifetime of variables by moving their definitions to an
inner scope where appropriate.
* ep/varscope:
builtin/gc.c: reduce scope of variables
builtin/fetch.c: reduce scope of variable
builtin/commit.c: reduce scope of variables
builtin/clean.c: reduce scope of variable
builtin/blame.c: reduce scope of variables
builtin/apply.c: reduce scope of variables
bisect.c: reduce scope of variable
Diffstat (limited to 'builtin/fetch.c')
-rw-r--r-- | builtin/fetch.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c index 025bc3e38d..55f457c04f 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -1026,7 +1026,6 @@ static int fetch_multiple(struct string_list *list) static int fetch_one(struct remote *remote, int argc, const char **argv) { - int i; static const char **refs = NULL; struct refspec *refspec; int ref_nr = 0; @@ -1050,6 +1049,7 @@ static int fetch_one(struct remote *remote, int argc, const char **argv) if (argc > 0) { int j = 0; + int i; refs = xcalloc(argc + 1, sizeof(const char *)); for (i = 0; i < argc; i++) { if (!strcmp(argv[i], "tag")) { |