Skip to content

Commit

Permalink
Don't show gitlink directories when we want "other" files
Browse files Browse the repository at this point in the history
When "show_other_directories" is set, that implies that we are looking
for untracked files, which obviously means that we should ignore
directories that are marked as gitlinks in the index.

This fixes "git status" in a superproject, that would otherwise always
report that subprojects were "Untracked files:"

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Linus Torvalds authored and Junio C Hamano committed Apr 12, 2007
1 parent e011054 commit ab22aed
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,8 @@ static enum directory_treatment treat_directory(struct dir_struct *dir,
return recurse_into_directory;

case index_gitdir:
if (dir->show_other_directories)
return ignore_directory;
return show_directory;

case index_nonexistent:
Expand Down

0 comments on commit ab22aed

Please sign in to comment.