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

[PATCHv2 4/6] builtin/fetch.c: respect 'submodule.recurse' option

From
Stefan Beller <sbeller@google.com>
Date
May 22, 2017, 19:48 UTC
Message-ID
<20170522194806.13568-5-sbeller@google.com>
In-Reply-To
<20170522194806.13568-1-sbeller@google.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
---
 submodule.c                 |  1 +
 t/t5526-fetch-submodules.sh | 10 ++++++++++
 2 files changed, 11 insertions(+)
diff --git a/submodule.c b/submodule.c
index 5d7aa711c8..0bf268b196 100644
--- a/submodule.c
+++ b/submodule.c
@@ -94,6 +94,7 @@ static int submodule_config(const char *var, const char *value, void *cb)
 	if (!strcmp(var, "submodule.recurse")) {
 		int v = git_config_bool(var, value) ?
 			RECURSE_SUBMODULES_ON : RECURSE_SUBMODULES_OFF;
+		config_fetch_recurse_submodules = v;
 		config_update_recurse_submodules = v;
 	} else if (!strcmp(var, "submodule.fetchjobs")) {
 		submodule_config_reading = SUBMODULE_CONFIG_EXISTS;
diff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh
index f3b0a8d30a..162baf101f 100755
--- a/t/t5526-fetch-submodules.sh
+++ b/t/t5526-fetch-submodules.sh
@@ -71,6 +71,16 @@ test_expect_success "fetch --recurse-submodules recurses into submodules" '
 	test_i18ncmp expect.err actual.err
 '
 
+test_expect_success "submodule.recurse option triggers recursive fetch" '
+	add_upstream_commit &&
+	(
+		cd downstream &&
+		git -c submodule.recurse fetch >../actual.out 2>../actual.err
+	) &&
+	test_must_be_empty actual.out &&
+	test_i18ncmp expect.err actual.err
+'
+
 test_expect_success "fetch --recurse-submodules -j2 has the same output behaviour" '
 	add_upstream_commit &&
 	(
-- 
2.13.0.18.g7d86cc8ba0
Previous: Stefan BellerNext: Stefan Beller
Message 7 of 11 in “[PATCHv2 0/6] Add option to recurse into submodules”
  1. Stefan BellerMay 22, 2017
  2. 3/6 Introduce submodule.recurse option for worktree manipulatorsStefan Beller, May 22, 2017
  3. 2/6 submodule test invocation: only pass additional argumentsStefan Beller, May 22, 2017
  4. Junio C HamanoMay 23, 2017
  5. Stefan BellerMay 23, 2017
  6. 5/6 builtin/grep.c: respect 'submodule.recurse' optionStefan Beller, May 22, 2017
  7. 4/6 builtin/fetch.c: respect 'submodule.recurse' optionStefan Beller, May 22, 2017
  8. 6/6 builtin/push.c: respect 'submodule.recurse' optionStefan Beller, May 22, 2017
  9. 1/6 submodule.c: add has_submodules to check if we have any submodulesStefan Beller, May 22, 2017
  10. Brandon WilliamsMay 23, 2017
  11. Stefan BellerMay 23, 2017

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.