Don't show gitlink directories when we want "other" files
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>
Linus Torvalds committed
Apr 12, 2007 at 14:32 UTC
ab22aed3b7517c6390cb622b368bfcf503b7a37a
1 file changed
+2
dir.c
+2
@@ -375,6 +375,8 @@ static enum directory_treatment treat_directory(struct dir_struct *dir,
375
return recurse_into_directory;
376
377
case index_gitdir:
378
+ if (dir->show_other_directories)
379
+ return ignore_directory;
380
return show_directory;
381
382
case index_nonexistent: