{"thread":{"id":"7631","subject":"Don't show gitlink directories when we want \"other\" files","startedAt":"2007-04-12T21:32:21Z","lastAt":"2007-04-12T21:32:21Z","messageCount":1,"participants":["Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"39232","messageId":"Pine.LNX.4.64.0704121430580.4061@woody.linux-foundation.org","threadId":"7631","inReplyTo":null,"subject":"Don't show gitlink directories when we want \"other\" files","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-04-12T21:32:21Z","receivedAt":"2007-04-12T21:32:21Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\nWhen \"show_other_directories\" is set, that implies that we are looking\nfor untracked files, which obviously means that we should ignore\ndirectories that are marked as gitlinks in the index.\n\nThis fixes \"git status\" in a superproject, that would otherwise always \nreport that subprojects were \"Untracked files:\"\n\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\n---\n dir.c |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/dir.c b/dir.c\nindex 7b91501..6564a92 100644\n--- a/dir.c\n+++ b/dir.c\n@@ -375,6 +375,8 @@ static enum directory_treatment treat_directory(struct dir_struct *dir,\n \t\treturn recurse_into_directory;\n \n \tcase index_gitdir:\n+\t\tif (dir->show_other_directories)\n+\t\t\treturn ignore_directory;\n \t\treturn show_directory;\n \n \tcase index_nonexistent:\n"}]}