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

[PATCH v3 3/3] t7400: add test to check 'submodule add' for tracked paths

From
SSShourya Shukla <periperidip@gmail.com>
Date
Dec 14, 2020, 23:19 UTC
Message-ID
<20201214231939.644175-4-periperidip@gmail.com>
In-Reply-To
<20201214231939.644175-1-periperidip@gmail.com>

Add test to check if 'git submodule add' works on paths which are tracked by Git.

Helped-by: Christian Couder <christian.couder@gmail.com>
Helped-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Signed-off-by: Shourya Shukla <periperidip@gmail.com>
---
 t/t7400-submodule-basic.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index 4ab8298385..d9317192e0 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -193,6 +193,17 @@ test_expect_success 'submodule add to .gitignored path with --force' '
 	)
 '
 
+test_expect_success 'submodule add to path with tracked contents fails' '
+	(
+		cd addtest-ignore &&
+		mkdir track &&
+		git add -f track &&
+		git commit -m "add tracked path" &&
+		! git submodule add "$submodurl" submod >output 2>&1 &&
+		test_file_not_empty output
+	)
+'
+
 test_expect_success 'submodule add to reconfigure existing submodule with --force' '
 	(
 		cd addtest-ignore &&
-- 
2.25.1
Previous: Shourya ShuklaNext: Junio C Hamano
Message 6 of 10 in “submodule: port subcommand add from shell to C”
  1. 0/3 submodule: port subcommand add from shell to CShourya Shukla, Dec 14, 2020
  2. 1/3 dir: change the scope of function 'directory_exists_in_index()'Shourya Shukla, Dec 14, 2020
  3. Johannes SchindelinDec 19, 2020
  4. Junio C HamanoDec 19, 2020
  5. 2/3 submodule: port submodule subcommand 'add' from shell to CShourya Shukla, Dec 14, 2020
  6. 3/3 t7400: add test to check 'submodule add' for tracked pathsShourya Shukla, Dec 14, 2020
  7. Junio C HamanoDec 15, 2020
  8. Shourya ShuklaDec 17, 2020
  9. Junio C HamanoDec 17, 2020
  10. Junio C HamanoDec 22, 2020

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.