Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-07-14 12:35:24 +0400
committerJunio C Hamano <gitster@pobox.com>2013-07-15 21:56:06 +0400
commit5fee4df7f43e52eed19da3529bc50735c6dcd58e (patch)
treef6314ade93d56af4a0c1dba983828c95f9f3859a /builtin/clean.c
parent0da7a53a76b48ea1b2ee6ebe7bd7fbcd7d5c3f9d (diff)
clean: remove unused variable "seen"
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/clean.c')
-rw-r--r--builtin/clean.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/builtin/clean.c b/builtin/clean.c
index 04e396b17a..f955a40204 100644
--- a/builtin/clean.c
+++ b/builtin/clean.c
@@ -155,7 +155,6 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
struct string_list exclude_list = STRING_LIST_INIT_NODUP;
struct exclude_list *el;
const char *qname;
- char *seen = NULL;
struct option options[] = {
OPT__QUIET(&quiet, N_("do not print names of files removed")),
OPT__DRY_RUN(&dry_run, N_("dry run")),
@@ -214,9 +213,6 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
fill_directory(&dir, pathspec);
- if (pathspec)
- seen = xmalloc(argc > 0 ? argc : 1);
-
for (i = 0; i < dir.nr; i++) {
struct dir_entry *ent = dir.entries[i];
int len, pos;
@@ -250,11 +246,9 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
if (lstat(ent->name, &st))
continue;
- if (pathspec) {
- memset(seen, 0, argc > 0 ? argc : 1);
+ if (pathspec)
matches = match_pathspec(pathspec, ent->name, len,
- 0, seen);
- }
+ 0, NULL);
if (S_ISDIR(st.st_mode)) {
strbuf_addstr(&directory, ent->name);
@@ -281,7 +275,6 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
}
}
}
- free(seen);
strbuf_release(&directory);
string_list_clear(&exclude_list, 0);