Skip to content

Commit

Permalink
fix(git): always set origin name when cloning (#622)
Browse files Browse the repository at this point in the history
* fix(git): force origin name

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

This reverts commit 5af9380.
  • Loading branch information
sbaildon committed Mar 5, 2023
1 parent 1407565 commit 53be2c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 1 addition & 3 deletions lua/lazy/manage/git.lua
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,7 @@ end

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

---@param repo string
Expand Down
2 changes: 2 additions & 0 deletions lua/lazy/manage/task/git.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ M.clone = {
args[#args + 1] = "--recurse-submodules"
end

args[#args + 1] = "--origin=origin"

args[#args + 1] = "--progress"

if self.plugin.branch then
Expand Down

0 comments on commit 53be2c0

Please sign in to comment.