Skip to content

Commit

Permalink
clean: remove unused variable "seen"
Browse files Browse the repository at this point in the history
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Nguyễn Thái Ngọc Duy authored and Junio C Hamano committed Jul 15, 2013
1 parent 0da7a53 commit 5fee4df
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions builtin/clean.c
Original file line number Diff line number Diff line change
Expand Up @@ -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")),
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 5fee4df

Please sign in to comment.