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

[PATCH 1/2] Check recursive submodule update to have correct path from subdirectory

From
Stefan Beller <sbeller@google.com>
Date
Feb 26, 2016, 20:51 UTC
Message-ID
<1456519912-10641-2-git-send-email-sbeller@google.com>
In-Reply-To
<1456519912-10641-1-git-send-email-sbeller@google.com>

A similar test exists for `submodule sync` to behave well when being in an unrelated subdirectory and performing operations on submodules.

Signed-off-by: Stefan Beller <sbeller@google.com>
---
 t/t7406-submodule-update.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index 68ea31d..628da7f 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -774,4 +774,16 @@ test_expect_success 'submodule update --recursive drops module name before recur
 	 test_i18ngrep "Submodule path .deeper/submodule/subsubmodule.: checked out" actual
 	)
 '
+
+test_expect_success 'submodule update --recursive works from subdirectory' '
+	(cd super2 &&
+	 (cd deeper/submodule/subsubmodule &&
+	  git checkout HEAD^
+	 ) &&
+	 mkdir untracked &&
+	 cd untracked &&
+	 git submodule update --recursive >actual &&
+	 test_i18ngrep "Submodule path .../deeper/submodule/subsubmodule.: checked out" actual
+	)
+'
 test_done
-- 
2.7.2.368.g934fe14
Previous: Stefan BellerNext: Stefan Beller
Message 2 of 4 in “recursive submodules: paths are hard”
  1. 0/2 recursive submodules: paths are hardStefan Beller, Feb 26, 2016
  2. 1/2 Check recursive submodule update to have correct path from subdirectoryStefan Beller, Feb 26, 2016
  3. 2/2 submodule sync: Test we can pass individual submodulesStefan Beller, Feb 26, 2016
  4. Duy NguyenFeb 27, 2016

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.