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

[PATCH 2/3] t7406-submodule-update: demonstrate behaviour when run without init beforehand

From
Tay Ray Chuan <rctay89@gmail.com>
Date
Sep 15, 2013, 17:38 UTC
Message-ID
<1379266703-29808-2-git-send-email-rctay89@gmail.com>
In-Reply-To
<1379266703-29808-1-git-send-email-rctay89@gmail.com>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
 t/t7406-submodule-update.sh | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index f0b3305..00475eb 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -66,6 +66,26 @@ test_expect_success 'setup a submodule tree' '
 	)
 '
 
+test_expect_success 'setup a repo with uninitialized submodules' '
+	git clone super super2
+'
+
+test_expect_success 'submodule update <path> warns without init beforehand' '
+	(cd super2 &&
+	 test -n "$(git submodule update submodule)"
+	)
+'
+
+test_expect_success 'submodule update is silent without init beforehand' '
+	(cd super2 &&
+	 test -z "$(git submodule update)"
+	)
+'
+
+test_expect_success 'cleanup repo with uninitialized submodules' '
+	rm -rf super2
+'
+
 test_expect_success 'submodule update detaching the HEAD ' '
 	(cd super/submodule &&
 	 git reset --hard HEAD~1
-- 
1.8.4.rc4.527.g303b16c
Previous: Tay Ray ChuanNext: Tay Ray Chuan
Message 2 of 7 in “t7406-submodule-update: add missing &&”
  1. 1/3 t7406-submodule-update: add missing &&Tay Ray Chuan, Sep 15, 2013
  2. 2/3 t7406-submodule-update: demonstrate behaviour when run without init beforehandTay Ray Chuan, Sep 15, 2013
  3. 3/3 git submodule update should give notice when run without init beforehandTay Ray Chuan, Sep 15, 2013
  4. Jens LehmannSep 16, 2013
  5. Tay Ray ChuanSep 18, 2013
  6. Jens LehmannSep 18, 2013
  7. Chris PackhamSep 19, 2013

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.