aboutsummaryrefslogtreecommitdiff
path: root/builtin/clean.c
diff options
context:
space:
mode:
authorAdam Spiers <git@adamspiers.org>2013-01-06 16:58:04 +0000
committerJunio C Hamano <gitster@pobox.com>2013-01-06 14:26:37 -0800
commitc04318e46aae79b8b8df059e2118519d83dfee12 (patch)
tree714436b653a34517e552024b0d1d2c9f94644997 /builtin/clean.c
parentc082df24539329c2e75395cf378f0a3fe187c028 (diff)
downloadgit-c04318e46aae79b8b8df059e2118519d83dfee12.tar.gz
git-c04318e46aae79b8b8df059e2118519d83dfee12.tar.xz
dir.c: keep track of where patterns came from
For exclude patterns read in from files, the filename is stored in the exclude list, and the originating line number is stored in the individual exclude (counting starting at 1). For exclude patterns provided on the command line, a string describing the source of the patterns is stored in the exclude list, and the sequence number assigned to each exclude pattern is negative, with counting starting at -1. So for example the 2nd pattern provided via --exclude would be numbered -2. This allows any future consumers of that data to easily distinguish between exclude patterns from files vs. from the CLI. Signed-off-by: Adam Spiers <git@adamspiers.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/clean.c')
-rw-r--r--builtin/clean.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/clean.c b/builtin/clean.c
index dd8973700..b098288ad 100644
--- a/builtin/clean.c
+++ b/builtin/clean.c
@@ -97,10 +97,10 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
if (!ignored)
setup_standard_excludes(&dir);
- add_exclude_list(&dir, EXC_CMDL);
+ add_exclude_list(&dir, EXC_CMDL, "--exclude option");
for (i = 0; i < exclude_list.nr; i++)
add_exclude(exclude_list.items[i].string, "", 0,
- &dir.exclude_list_group[EXC_CMDL].el[0]);
+ &dir.exclude_list_group[EXC_CMDL].el[0], -(i+1));
pathspec = get_pathspec(prefix, argv);