Skip to content

Commit e552778

Browse files
committed
fix: update git impl matches new shell.execute behavior
1 parent 400618a commit e552778

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lua/gx/git.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
M = {}
22

33
local function parse_git_output(result)
4-
if not result or #result < 1 then
4+
if not result or #result < 0 then
55
return
66
end
77

8-
local domain, repository = result[1]:gsub("%.git%s*$", ""):match("@(.*%..*):(.*)$")
8+
result = vim.trim(result)
9+
local domain, repository = result:gsub("%.git%s*$", ""):match("@(.*%..*):(.*)$")
910
if domain and repository then
1011
return "https://" .. domain .. "/" .. repository
1112
end
1213

13-
local url = result[1]:gsub("%.git%s*$", ""):match("^https?://.+")
14+
local url = result:gsub("%.git%s*$", ""):match("^https?://.+")
1415
if url then
1516
return url
1617
end

lua/gx/shell.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ local shell = {}
22

33
function shell.execute(command, args, options)
44
local cmd = { command, unpack(args) }
5+
options = options or {}
56
local opts = vim.tbl_extend("force", {}, options)
67

78
local obj = vim.system(cmd, opts):wait()

0 commit comments

Comments
 (0)