refactor(git): consolidate sync subprocess pattern via util.system_sync

This commit is contained in:
2026-04-28 08:38:14 +02:00
parent d2633ae9c2
commit 4390b55dfe
5 changed files with 57 additions and 67 deletions
+2 -5
View File
@@ -336,11 +336,8 @@ function M.rev_parse(worktree, ref, short)
table.insert(cmd, "--short")
end
table.insert(cmd, ref)
local result = vim.system(cmd, { cwd = worktree, text = true }):wait()
if result.code ~= 0 then
return nil
end
local trimmed = vim.trim(result.stdout or "")
local stdout = util.system_sync(cmd, { cwd = worktree, silent = true })
local trimmed = stdout and vim.trim(stdout) or ""
return trimmed ~= "" and trimmed or nil
end