git ls files recursively show ignored files
Make git-ls-files --others --ignored recurse into non-excluded subdirectories. Typically when asking git-ls-files to display all files which are ignored by one or more exclude patterns one would want it to recurse into subdirectories which are not themselves excluded to see if there are any excluded files contained within those subdirectories. Signed-off-by: Junio C Hamano <junkio@cox.net>
Shawn Pearce committed
Feb 24, 2006 at 17:02 UTC
1e3584053d56157549c01114f9550d1db7014a3e
1 file changed
+5
-2
ls-files.c
+5
-2
@@ -279,8 +279,11 @@ static void read_directory(const char *path, const char *base, int baselen)
279
continue;
280
len = strlen(de->d_name);
281
memcpy(fullname + baselen, de->d_name, len+1);
282
- if (excluded(fullname) != show_ignored)
283
- continue;
282
+ if (excluded(fullname) != show_ignored) {
283
+ if (!show_ignored || DTYPE(de) != DT_DIR) {
284
+ continue;
285
+ }
286
+ }
287
288
switch (DTYPE(de)) {
289
struct stat st;