ls-files: convert ce_excluded 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
1d35e3bf056b508f4ece3875f9d2851be5fcd3d4
1 file changed
+5
-4
builtin/ls-files.c
+5
-4
@@ -321,10 +321,11 @@ static void show_ru_info(const struct index_state *istate)
321
}
322
}
323
324
-static int ce_excluded(struct dir_struct *dir, const struct cache_entry *ce)
324
+static int ce_excluded(struct dir_struct *dir, struct index_state *istate,
325
+ const struct cache_entry *ce)
326
{
327
int dtype = ce_to_dtype(ce);
327
- return is_excluded(dir, &the_index, ce->name, &dtype);
328
+ return is_excluded(dir, istate, ce->name, &dtype);
329
}
330
331
static void show_files(struct dir_struct *dir)
@@ -345,7 +346,7 @@ static void show_files(struct dir_struct *dir)
346
for (i = 0; i < active_nr; i++) {
347
const struct cache_entry *ce = active_cache[i];
348
if ((dir->flags & DIR_SHOW_IGNORED) &&
348
- !ce_excluded(dir, ce))
349
+ !ce_excluded(dir, &the_index, ce))
350
continue;
351
if (show_unmerged && !ce_stage(ce))
352
continue;
@@ -361,7 +362,7 @@ static void show_files(struct dir_struct *dir)
362
struct stat st;
363
int err;
364
if ((dir->flags & DIR_SHOW_IGNORED) &&
364
- !ce_excluded(dir, ce))
365
+ !ce_excluded(dir, &the_index, ce))
366
continue;
367
if (ce->ce_flags & CE_UPDATE)
368
continue;