Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lua/snacks/gitbrowse.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function M.get_repo(remote, opts)
for _, pattern in ipairs(opts.remote_patterns) do
ret = ret:gsub(pattern[1], pattern[2]) --[[@as string]]
end
return ret:find("https://") == 1 and ret or ("https://%s"):format(ret)
return ret:find("https?://") == 1 and ret or ("https://%s"):format(ret)
end

---@param repo string
Expand Down
2 changes: 2 additions & 0 deletions tests/gitbrowse_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ local git_remotes_cases = {
["https://git.sr.ht/~user/repo"] = "https://git.sr.ht/~user/repo",
["git@git.sr.ht:~user/another-repo"] = "https://git.sr.ht/~user/another-repo",
["https://git.sr.ht/~user/another-repo"] = "https://git.sr.ht/~user/another-repo",
["http://git.example.com/group/subgroup/repo.git"] = "http://git.example.com/group/subgroup/repo",
["http://git.example.com/group/subgroup/repo"] = "http://git.example.com/group/subgroup/repo",
}

describe("util.lazygit", function()
Expand Down
Loading