diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-11-20 14:42:59 +0900 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-11-20 14:43:00 +0900 |
| commit | cc53ddf7f03040c3353ee9501a4250c69fbd25db (patch) | |
| tree | 03c03d5e1533f6e34d321d38787f4284d8bf1cb2 /builtin | |
| parent | Merge branch 'ps/cache-tree-w-broken-index-entry' into maint-2.47 (diff) | |
| parent | submodule: correct remote name with fetch (diff) | |
| download | git-cc53ddf7f03040c3353ee9501a4250c69fbd25db.tar.gz git-cc53ddf7f03040c3353ee9501a4250c69fbd25db.zip | |
Merge branch 'db/submodule-fetch-with-remote-name-fix' into maint-2.47
A "git fetch" from the superproject going down to a submodule used
a wrong remote when the default remote names are set differently
between them.
* db/submodule-fetch-with-remote-name-fix:
submodule: correct remote name with fetch
Diffstat (limited to 'builtin')
| -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); |
