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/clean.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/clean.c')
-rw-r--r-- | builtin/clean.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/clean.c b/builtin/clean.c index cb02a5330a..114d7bf879 100644 --- a/builtin/clean.c +++ b/builtin/clean.c @@ -154,7 +154,7 @@ static int remove_dirs(struct strbuf *path, const char *prefix, int force_flag, DIR *dir; struct strbuf quoted = STRBUF_INIT; struct dirent *e; - int res = 0, ret = 0, gone = 1, original_len = path->len, len, i; + int res = 0, ret = 0, gone = 1, original_len = path->len, len; unsigned char submodule_head[20]; struct string_list dels = STRING_LIST_INIT_DUP; @@ -242,6 +242,7 @@ static int remove_dirs(struct strbuf *path, const char *prefix, int force_flag, } if (!*dir_gone && !quiet) { + int i; for (i = 0; i < dels.nr; i++) printf(dry_run ? _(msg_would_remove) : _(msg_remove), dels.items[i].string); } |