path: root/builtin/clean.c
diff options
authorJunio C Hamano <>2013-01-24 05:19:10 (GMT)
committerJunio C Hamano <>2013-01-24 05:19:10 (GMT)
commita39b15b4f6a3f08b67b17d968935d177821e680f (patch)
tree188d8c7c1b4a4efa027516be3808db5e37b2bf13 /builtin/clean.c
parentf12e49ae877ad0644b9b9939b7cb742da98691d2 (diff)
parent72aeb18772deeb386da7dd8997b969877bd29e41 (diff)
Merge branch 'as/check-ignore'
Add a new command "git check-ignore" for debugging .gitignore files. The variable names may want to get cleaned up but that can be done in-tree. * as/check-ignore: clean.c, ls-files.c: respect encapsulation of exclude_list_groups t0008: avoid brace expansion add git-check-ignore sub-command setup.c: document get_pathspec() add.c: extract new die_if_path_beyond_symlink() for reuse add.c: extract check_path_for_gitlink() from treat_gitlinks() for reuse pathspec.c: rename newly public functions for clarity add.c: move pathspec matchers into new pathspec.c for reuse add.c: remove unused argument from validate_pathspec() dir.c: improve docs for match_pathspec() and match_pathspec_depth() dir.c: provide clear_directory() for reclaiming dir_struct memory dir.c: keep track of where patterns came from dir.c: use a single struct exclude_list per source of excludes Conflicts: builtin/ls-files.c dir.c
Diffstat (limited to 'builtin/clean.c')
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/clean.c b/builtin/clean.c
index f4b760b..04e396b 100644
--- a/builtin/clean.c
+++ b/builtin/clean.c
@@ -153,6 +153,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
static const char **pathspec;
struct strbuf buf = STRBUF_INIT;
struct string_list exclude_list = STRING_LIST_INIT_NODUP;
+ struct exclude_list *el;
const char *qname;
char *seen = NULL;
struct option options[] = {
@@ -205,9 +206,9 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
if (!ignored)
+ el = add_exclude_list(&dir, EXC_CMDL, "--exclude option");
for (i = 0; i <; i++)
- add_exclude(exclude_list.items[i].string, "", 0,
- &dir.exclude_list[EXC_CMDL]);
+ add_exclude(exclude_list.items[i].string, "", 0, el, -(i+1));
pathspec = get_pathspec(prefix, argv);