Skip to content

Commit

Permalink
fix: parsing of remotes without .git suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
ten3roberts committed Jul 16, 2023
1 parent 6ee2a96 commit bf36758
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lua/neogit/popups/remote/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ function M.add(popup)
end

local origin = git.config.get("remote.origin.url").value
local host, remote = origin:match("([^:/]+)[^/]+(.-%.git)")
local remote_url = input.get_user_input("Remote url: ", host .. ":" .. name .. remote)
local host, _, remote = origin:match("([^:/]+)[:/]([^/]+)/(.+)")

remote = remote:gsub("%.git$", "")
local msg = string.format("%s:%s/%s", host, name, remote)

local remote_url = input.get_user_input("Remote url: ", msg)
if not remote_url then
return
end
Expand Down

0 comments on commit bf36758

Please sign in to comment.