refactor(git): unify diff/object dispatch, codify naming, add :Gdiffsplit

This commit is contained in:
2026-04-29 09:47:51 +02:00
parent 44f9503960
commit 5c5da7a854
10 changed files with 587 additions and 443 deletions
+14
View File
@@ -343,4 +343,18 @@ function M.rev_parse(worktree, ref, short)
return trimmed ~= "" and trimmed or nil
end
---Verify a revspec resolves to an existing git object. `cat-file -e` is
---git's cheapest existence check, and unlike `rev-parse --verify` it
---also accepts the `<commit>:<path>` form that BufReadCmd revspec URIs
---use.
---@param worktree string
---@param revspec string
---@return boolean
function M.object_exists(worktree, revspec)
return util.exec(
{ "git", "cat-file", "-e", revspec },
{ cwd = worktree, silent = true }
) ~= nil
end
return M