From: Daniel Black <daniel@mariadb.org>
To: git@vger.kernel.org
Cc: Daniel Black <daniel@mariadb.org>
Subject: [PATCH] submodule: correct remote name with fetch
Date: Tue, 1 Oct 2024 17:24:23 +1000 [thread overview]
Message-ID: <20241001072423.1165932-1-daniel@mariadb.org> (raw)
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
next prev parent reply other threads:[~2024-10-01 7:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-22 11:09 bug: submodule update fails to fetch Sergei Golubchik
2023-06-22 13:07 ` Taylor Blau
2023-06-22 16:39 ` Sergei Golubchik
2023-06-23 7:26 ` Jacob Keller
2024-10-01 7:24 ` Daniel Black [this message]
2024-10-01 17:27 ` [PATCH] submodule: correct remote name with fetch Junio C Hamano
2024-10-01 17:34 ` Junio C Hamano
2024-10-08 1:49 ` Daniel Black
2024-10-08 1:49 ` [RFC PATCH v2] submodule: correct remote name with fetch Daniel Black
2024-10-08 19:23 ` Junio C Hamano
2024-10-09 3:32 ` [PATCH v3] " Daniel Black
2024-10-09 17:51 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241001072423.1165932-1-daniel@mariadb.org \
--to=daniel@mariadb.org \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).