diff options
| author | Daniel Black <daniel@mariadb.org> | 2024-10-09 14:32:54 +1100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-10-09 10:48:08 -0700 |
| commit | 0c1a9987da0507050d9dba2adba208d14b944b3a (patch) | |
| tree | 02aabe16077c13cba5b9e90d2605af3c8b817342 /builtin/submodule--helper.c | |
| parent | 777489f9e09c8d0dd6b12f9d90de6376330577a2 (diff) | |
| download | git-0c1a9987da0507050d9dba2adba208d14b944b3a.tar.gz | |
submodule: correct remote name with fetch
The code fetches the submodules remote based on the superproject remote name
instead of the submodule remote name[1].
Instead of grabbing the default remote of the superproject repository, ask
the default remote of the submodule we are going to run 'git fetch' in.
1. https://lore.kernel.org/git/ZJR5SPDj4Wt_gmRO@pweza/
Signed-off-by: Daniel Black <daniel@mariadb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/submodule--helper.c')
| -rw-r--r-- | builtin/submodule--helper.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index dc89488a7d..b6b5f1ebde 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -2333,7 +2333,14 @@ 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) { + child_process_clear(&cp); + return code; + } strvec_pushl(&cp.args, remote, hex, NULL); free(remote); |
