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

[PATCHv3 3/5] submodule update: add test for recursive from non root dir

From
Stefan Beller <sbeller@google.com>
Date
Mar 25, 2016, 18:39 UTC
Message-ID
<1458931156-29125-4-git-send-email-sbeller@google.com>
In-Reply-To
<1458931156-29125-1-git-send-email-sbeller@google.com>

Test "submodule update --recursive" being invoked from a sub directory as this is currently not covered by the test suite.

Signed-off-by: Stefan Beller <sbeller@google.com>
---
 t/t7406-submodule-update.sh | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index 68ea31d..19d8552 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -767,11 +767,19 @@ test_expect_success 'submodule update clone shallow submodule' '
 
 test_expect_success 'submodule update --recursive drops module name before recursing' '
 	(cd super2 &&
-	 (cd deeper/submodule/subsubmodule &&
-	  git checkout HEAD^
-	 ) &&
+	 git -C deeper/submodule/subsubmodule checkout HEAD^
 	 git submodule update --recursive deeper/submodule >actual &&
 	 test_i18ngrep "Submodule path .deeper/submodule/subsubmodule.: checked out" actual
 	)
 '
+
+test_expect_success 'submodule update --recursive works from subdirectory' '
+	(cd super2 &&
+	 git -C deeper/submodule/subsubmodule checkout HEAD^
+	 mkdir untracked &&
+	 cd untracked &&
+	 git submodule update --recursive >actual &&
+	 test_i18ngrep "Submodule path .../deeper/submodule/subsubmodule.: checked out" actual
+	)
+'
 test_done
-- 
2.8.0.rc4.10.g52f3f33.dirty
Previous: Stefan BellerNext: Stefan Beller
Message 5 of 15 in “[PATCHv3 0/5] submodule helper: cleanup prefix passing”
  1. Stefan BellerMar 25, 2016
  2. 1/5 submodule: prepare recursive path from non root directoryStefan Beller, Mar 25, 2016
  3. Junio C HamanoMar 25, 2016
  4. 2/5 submodule--helper list: lose the extra prefix optionStefan Beller, Mar 25, 2016
  5. 3/5 submodule update: add test for recursive from non root dirStefan Beller, Mar 25, 2016
  6. 4/5 submodule sync: test syncing one submoduleStefan Beller, Mar 25, 2016
  7. 5/5 submodule--helper clone: lose the extra prefix optionStefan Beller, Mar 25, 2016
  8. Junio C HamanoMar 25, 2016
  9. Junio C HamanoMar 25, 2016
  10. Stefan BellerMar 25, 2016
  11. Junio C HamanoMar 25, 2016
  12. Stefan BellerMar 25, 2016
  13. Junio C HamanoMar 25, 2016
  14. Stefan BellerMar 25, 2016
  15. Junio C HamanoMar 28, 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.