summaryrefslogtreecommitdiff
path: root/builtin/ls-files.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2017-06-12 22:14:01 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-06-13 18:40:51 (GMT)
commit23d6846b2324ef647a339b84ba3abc52e0a4dc94 (patch)
tree99ebac13816b2a5a30c600cd52f1be4d089469ff /builtin/ls-files.c
parent23d6236a07be1434479a5d2f1f82cd8dda4818f9 (diff)
downloadgit-23d6846b2324ef647a339b84ba3abc52e0a4dc94.zip
git-23d6846b2324ef647a339b84ba3abc52e0a4dc94.tar.gz
git-23d6846b2324ef647a339b84ba3abc52e0a4dc94.tar.bz2
ls-files: convert show_other_files 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/ls-files.c')
-rw-r--r--builtin/ls-files.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/builtin/ls-files.c b/builtin/ls-files.c
index b82b780..5dbff94 100644
--- a/builtin/ls-files.c
+++ b/builtin/ls-files.c
@@ -108,13 +108,14 @@ static void show_dir_entry(const char *tag, struct dir_entry *ent)
write_name(ent->name);
}
-static void show_other_files(struct dir_struct *dir)
+static void show_other_files(const struct index_state *istate,
+ const struct dir_struct *dir)
{
int i;
for (i = 0; i < dir->nr; i++) {
struct dir_entry *ent = dir->entries[i];
- if (!cache_name_is_other(ent->name, ent->len))
+ if (!index_name_is_other(istate, ent->name, ent->len))
continue;
show_dir_entry(tag_other, ent);
}
@@ -336,7 +337,7 @@ static void show_files(struct dir_struct *dir)
dir->flags |= DIR_COLLECT_KILLED_ONLY;
fill_directory(dir, &the_index, &pathspec);
if (show_others)
- show_other_files(dir);
+ show_other_files(&the_index, dir);
if (show_killed)
show_killed_files(&the_index, dir);
}