From b292a721bfce1b079428a3a42aa9ea3454c5692d Mon Sep 17 00:00:00 2001 From: Roman Nesytov Date: Sat, 29 Jun 2024 11:42:46 +0300 Subject: [PATCH] fix(lazygit): fix browsing private git hostings (#3833) ## What is this PR for? Current implementation of `Git Browse` doesn't work with onprem gitlab (and any other git hosting except gitlab, github and bitbucket). With this little fix, it should work with any git hosting. ## Does this PR fix an existing issue? No ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/util/lazygit.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/lazygit.lua b/lua/lazyvim/util/lazygit.lua index d69941df..630d009a 100644 --- a/lua/lazyvim/util/lazygit.lua +++ b/lua/lazyvim/util/lazygit.lua @@ -166,7 +166,7 @@ function M.browse() for _, line in ipairs(lines) do local name, url = line:match("(%S+)%s+(%S+)%s+%(fetch%)") 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$", "") end table.insert(remotes, { name = name, url = url })