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>

Nguyễn Thái Ngọc Duy committed Jul 14, 2013 at 15:35 UTC 5fee4df7f43e52eed19da3529bc50735c6dcd58e
1 file changed +2 -9
builtin/clean.c
+2 -9
@@ -155,7 +155,6 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
155 struct string_list exclude_list = STRING_LIST_INIT_NODUP;
156 struct exclude_list *el;
157 const char *qname;
158 - char *seen = NULL;
158 struct option options[] = {
159 OPT__QUIET(&quiet, N_("do not print names of files removed")),
160 OPT__DRY_RUN(&dry_run, N_("dry run")),
@@ -214,9 +213,6 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
213
214 fill_directory(&dir, pathspec);
215
217 - if (pathspec)
218 - seen = xmalloc(argc > 0 ? argc : 1);
219 -
216 for (i = 0; i < dir.nr; i++) {
217 struct dir_entry *ent = dir.entries[i];
218 int len, pos;
@@ -250,11 +246,9 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
246 if (lstat(ent->name, &st))
247 continue;
248
253 - if (pathspec) {
254 - memset(seen, 0, argc > 0 ? argc : 1);
249 + if (pathspec)
250 matches = match_pathspec(pathspec, ent->name, len,
256 - 0, seen);
257 - }
251 + 0, NULL);
252
253 if (S_ISDIR(st.st_mode)) {
254 strbuf_addstr(&directory, ent->name);
@@ -281,7 +275,6 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
275 }
276 }
277 }
284 - free(seen);
278
279 strbuf_release(&directory);
280 string_list_clear(&exclude_list, 0);