refactor(git): extract util.split_lines helper
This commit is contained in:
+2
-9
@@ -1,5 +1,6 @@
|
||||
local log = require("log")
|
||||
local repo = require("git.repo")
|
||||
local util = require("util")
|
||||
|
||||
local M = {}
|
||||
|
||||
@@ -70,15 +71,7 @@ local function read_show(worktree, revspec)
|
||||
)
|
||||
return {}
|
||||
end
|
||||
local lines = vim.split(
|
||||
result.stdout or "",
|
||||
"\n",
|
||||
{ plain = true, trimempty = false }
|
||||
)
|
||||
if #lines > 0 and lines[#lines] == "" then
|
||||
table.remove(lines)
|
||||
end
|
||||
return lines
|
||||
return util.split_lines(result.stdout or "")
|
||||
end
|
||||
|
||||
---@param worktree string
|
||||
|
||||
Reference in New Issue
Block a user