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>
Brandon Williams committed
Jun 12, 2017 at 15:14 UTC
23d6846b2324ef647a339b84ba3abc52e0a4dc94
1 file changed
+4
-3
builtin/ls-files.c
+4
-3
@@ -108,13 +108,14 @@ static void show_dir_entry(const char *tag, struct dir_entry *ent)
108
write_name(ent->name);
109
}
110
111
-static void show_other_files(struct dir_struct *dir)
111
+static void show_other_files(const struct index_state *istate,
112
+ const struct dir_struct *dir)
113
{
114
int i;
115
116
for (i = 0; i < dir->nr; i++) {
117
struct dir_entry *ent = dir->entries[i];
117
- if (!cache_name_is_other(ent->name, ent->len))
118
+ if (!index_name_is_other(istate, ent->name, ent->len))
119
continue;
120
show_dir_entry(tag_other, ent);
121
}
@@ -336,7 +337,7 @@ static void show_files(struct dir_struct *dir)
337
dir->flags |= DIR_COLLECT_KILLED_ONLY;
338
fill_directory(dir, &the_index, &pathspec);
339
if (show_others)
339
- show_other_files(dir);
340
+ show_other_files(&the_index, dir);
341
if (show_killed)
342
show_killed_files(&the_index, dir);
343
}