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

[PATCH 3/4] Teach git-submodule.sh about the .git file

From
LHLars Hjemli <hjemli@gmail.com>
Date
Feb 20, 2008, 22:13 UTC
Message-ID
<1203545596-6337-4-git-send-email-hjemli@gmail.com>
In-Reply-To
<1203545596-6337-3-git-send-email-hjemli@gmail.com>

When git-submodule tries to detect 'active' submodules, it checks for the existence of a directory named '.git'. This isn't good enough now that .git can be a file pointing to the real $GIT_DIR so the tests are changed to reflect this.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
---
 git-submodule.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-submodule.sh b/git-submodule.sh
index a6aaf40..e7c08b5 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -288,7 +288,7 @@ cmd_update()
 			continue
 		fi
 
-		if ! test -d "$path"/.git
+		if ! test -d "$path"/.git -o -f "$path"/.git
 		then
 			module_clone "$path" "$url" || exit
 			subsha1=
@@ -362,7 +362,7 @@ cmd_status()
 	do
 		name=$(module_name "$path") || exit
 		url=$(git config submodule."$name".url)
-		if test -z "url" || ! test -d "$path"/.git
+		if test -z "url" || ! test -d "$path"/.git -o -f "$path"/.git
 		then
 			say "-$sha1 $path"
 			continue;
-- 
1.5.4.1.188.g3ea1f5
Previous: Lars HjemliNext: Lars Hjemli
Message 4 of 5 in “Introducing the .git file”
  1. 0/4 Introducing the .git fileLars Hjemli, Feb 20, 2008
  2. 1/4 Add platform-independent .git "symlink"Lars Hjemli, Feb 20, 2008
  3. 2/4 Teach resolve_gitlink_ref() about the .git fileLars Hjemli, Feb 20, 2008
  4. 3/4 Teach git-submodule.sh about the .git fileLars Hjemli, Feb 20, 2008
  5. 4/4 Teach GIT-VERSION-GEN about the .git fileLars Hjemli, Feb 20, 2008

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.