fix(lazygit): fix browsing private git hostings

This commit is contained in:
Roman Nesytov 2024-06-27 23:07:02 +03:00
parent 44ed11c4f8
commit 433dfa9e7c

View file

@ -166,7 +166,7 @@ function M.browse()
for _, line in ipairs(lines) do for _, line in ipairs(lines) do
local name, url = line:match("(%S+)%s+(%S+)%s+%(fetch%)") local name, url = line:match("(%S+)%s+(%S+)%s+%(fetch%)")
if name and url then if name and url then
if url:find("git@github.com") or url:find("git@bitbucket.org") or url:find("git@gitlab.com") then if url:find("git@") == 1 then
url = url:gsub("git@(%S+):", "https://%1/"):gsub(".git$", "") url = url:gsub("git@(%S+):", "https://%1/"):gsub(".git$", "")
end end
table.insert(remotes, { name = name, url = url }) table.insert(remotes, { name = name, url = url })