Skip to content

Commit

Permalink
fix(git): fix stdout parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
tanvirtin committed Mar 7, 2024
1 parent b94967a commit dd8889d
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions lua/vgit/core/ReadStream.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,18 @@ function ReadStream:parse_result(output, callback)
return
end

local lines = table.concat(output)
:gmatch("[^\n]+")
local line = {}
output = table.concat(output)

for line in lines do
callback(line)
for i = 1, #output do
local char = output:sub(i, i)

if char == '\n' then
callback(table.concat(line))
line = {}
else
line[#line + 1] = char
end
end
end

Expand Down

0 comments on commit dd8889d

Please sign in to comment.