mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
update comment
This commit is contained in:
parent
e0f90f44a7
commit
5225aa9b31
1 changed files with 4 additions and 3 deletions
|
|
@ -186,10 +186,9 @@ function M.get_url(remote)
|
|||
|
||||
--- @param url string
|
||||
local function getRemoteURLFromSSH(url)
|
||||
local transformedUrl = ""
|
||||
local SSHConfigPath = vim.env.HOME .. "/.ssh/config"
|
||||
|
||||
-- Return the original URL if SSH config is not found or not readable
|
||||
-- Returns if SSH config is not found or not readable
|
||||
if not vim.uv.fs_access(SSHConfigPath, "R") then
|
||||
return
|
||||
end
|
||||
|
|
@ -197,11 +196,12 @@ function M.get_url(remote)
|
|||
-- Handle SSH config remotes
|
||||
local file = io.open(SSHConfigPath, "r")
|
||||
|
||||
-- Return the original URL if unable to read SSH config file
|
||||
-- Returns if unable to read SSH config file
|
||||
if not file then
|
||||
return
|
||||
end
|
||||
|
||||
local transformedUrl = ""
|
||||
local currentHost, hostGroup = "", {}
|
||||
for line in file:lines() do
|
||||
line = line:match("^%s*(.-)%s*$")
|
||||
|
|
@ -218,6 +218,7 @@ function M.get_url(remote)
|
|||
transformedUrl = url:gsub(searchString, destinationURL):gsub("%.git$", "")
|
||||
break
|
||||
end
|
||||
|
||||
-- Setup group of host
|
||||
currentHost = value
|
||||
hostGroup[currentHost] = {}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue