Skip to content

Commit

Permalink
git ls files recursively show ignored files
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shawn Pearce authored and Junio C Hamano committed Feb 25, 2006
1 parent 43f72af commit 1e35840
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ls-files.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,11 @@ static void read_directory(const char *path, const char *base, int baselen)
continue;
len = strlen(de->d_name);
memcpy(fullname + baselen, de->d_name, len+1);
if (excluded(fullname) != show_ignored)
continue;
if (excluded(fullname) != show_ignored) {
if (!show_ignored || DTYPE(de) != DT_DIR) {
continue;
}
}

switch (DTYPE(de)) {
struct stat st;
Expand Down

0 comments on commit 1e35840

Please sign in to comment.