Skip to content

Commit

Permalink
fix(git): honor clone.defaultRemoteName. Fixes #602
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Feb 28, 2023
1 parent 0f713b2 commit 5af9380
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/lazy/manage/git.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5af9380

Please sign in to comment.