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

[PATCH] submodule: correct remote name with fetch

From
Daniel Black <daniel@mariadb.org>
Date
Oct 1, 2024, 07:24 UTC
Message-ID
<20241001072423.1165932-1-daniel@mariadb.org>
In-Reply-To
<ZJQr0_aC-NlLXDgj@pweza>

The fetching of submodules erroniously used the main repository remote name instead of the submodule remote name[1].

Correct this by using the correct function to reteive the remote name.

1. https://www.spinics.net/lists/git/msg462320.html
Signed-off-by: Daniel Black <daniel@mariadb.org>
---
 builtin/submodule--helper.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index a1ada86952..210ae2570a 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -2322,7 +2322,12 @@ static int fetch_in_submodule(const char *module_path, int depth, int quiet,
 		strvec_pushf(&cp.args, "--depth=%d", depth);
 	if (oid) {
 		char *hex = oid_to_hex(oid);
-		char *remote = get_default_remote();
+		char *remote;
+		int code;
+
+		code = get_default_remote_submodule(module_path, &remote);
+		if (code)
+			return code;
 
 		strvec_pushl(&cp.args, remote, hex, NULL);
 		free(remote);
-- 
2.46.2
Previous: Jacob KellerNext: Junio C Hamano
Message 5 of 12 in “bug: submodule update fails to fetch”
  1. Sergei GolubchikJun 22, 2023
  2. Taylor BlauJun 22, 2023
  3. Sergei GolubchikJun 22, 2023
  4. Jacob KellerJun 23, 2023
  5. submodule: correct remote name with fetchDaniel Black, Oct 1, 2024
  6. Junio C HamanoOct 1, 2024
  7. Junio C HamanoOct 1, 2024
  8. Daniel Black, Oct 8, 2024
  9. submodule: correct remote name with fetchDaniel Black, Oct 8, 2024
  10. Junio C HamanoOct 8, 2024
  11. submodule: correct remote name with fetchDaniel Black, Oct 9, 2024
  12. Junio C HamanoOct 9, 2024

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.