fix(git): honor clone.defaultRemoteName. Fixes #602

This commit is contained in:
Folke Lemaitre 2023-02-28 10:51:17 +01:00
parent 0f713b2958
commit 5af93806aa
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 3 additions and 1 deletions

View File

@ -196,7 +196,9 @@ end
---@param repo string
function M.get_origin(repo)
return M.get_config(repo)["remote.origin.url"]
local config = M.get_config(repo)
local remote = config["clone.defaultRemoteName"] or "origin"
return config["remote." .. remote .. ".url"] or config["remote.origin.url"]
end
---@param repo string