summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2017-05-05 19:53:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-05-06 10:15:39 (GMT)
commita0bba65b107651946431bee4c71d05d812988d9d (patch)
tree2fdf86ac431244039da96a9d46127b073ff8d6f6 /builtin
parente799ed408eb59ca631c4908ba4236cd146ff6bd2 (diff)
downloadgit-a0bba65b107651946431bee4c71d05d812988d9d.zip
git-a0bba65b107651946431bee4c71d05d812988d9d.tar.gz
git-a0bba65b107651946431bee4c71d05d812988d9d.tar.bz2
dir: convert is_excluded to take an index
Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/add.c2
-rw-r--r--builtin/check-ignore.c3
-rw-r--r--builtin/clean.c2
-rw-r--r--builtin/ls-files.c2
4 files changed, 5 insertions, 4 deletions
diff --git a/builtin/add.c b/builtin/add.c
index bf5e676..0b52aec 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -436,7 +436,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
!file_exists(path))) {
if (ignore_missing) {
int dtype = DT_UNKNOWN;
- if (is_excluded(&dir, path, &dtype))
+ if (is_excluded(&dir, &the_index, path, &dtype))
dir_add_ignored(&dir, &the_index,
path, pathspec.items[i].len);
} else
diff --git a/builtin/check-ignore.c b/builtin/check-ignore.c
index 1d73d3c..d2293b2 100644
--- a/builtin/check-ignore.c
+++ b/builtin/check-ignore.c
@@ -101,7 +101,8 @@ static int check_ignore(struct dir_struct *dir,
full_path = pathspec.items[i].match;
exclude = NULL;
if (!seen[i]) {
- exclude = last_exclude_matching(dir, full_path, &dtype);
+ exclude = last_exclude_matching(dir, &the_index,
+ full_path, &dtype);
}
if (!quiet && (exclude || show_non_matching))
output_exclude(pathspec.items[i].original, exclude);
diff --git a/builtin/clean.c b/builtin/clean.c
index d861f83..39866af 100644
--- a/builtin/clean.c
+++ b/builtin/clean.c
@@ -683,7 +683,7 @@ static int filter_by_patterns_cmd(void)
for_each_string_list_item(item, &del_list) {
int dtype = DT_UNKNOWN;
- if (is_excluded(&dir, item->string, &dtype)) {
+ if (is_excluded(&dir, &the_index, item->string, &dtype)) {
*item->string = '\0';
changed++;
}
diff --git a/builtin/ls-files.c b/builtin/ls-files.c
index a6c70db..7a8c568 100644
--- a/builtin/ls-files.c
+++ b/builtin/ls-files.c
@@ -322,7 +322,7 @@ static void show_ru_info(void)
static int ce_excluded(struct dir_struct *dir, const struct cache_entry *ce)
{
int dtype = ce_to_dtype(ce);
- return is_excluded(dir, ce->name, &dtype);
+ return is_excluded(dir, &the_index, ce->name, &dtype);
}
static void show_files(struct dir_struct *dir)