git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Don't show gitlink directories when we want "other" files

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Apr 12, 2007, 21:32 UTC
Message-ID
<Pine.LNX.4.64.0704121430580.4061@woody.linux-foundation.org>

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>
---
 dir.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/dir.c b/dir.c
index 7b91501..6564a92 100644
--- a/dir.c
+++ b/dir.c
@@ -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:
Message 1 of 1 in “Don't show gitlink directories when we want "other" files”
  1. Linus TorvaldsApr 12, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.