feat(git): route :G cat-file -p <sha> through the object viewer

This commit is contained in:
2026-04-28 11:13:23 +02:00
parent 504c4a5ac1
commit 8425545087
+11
View File
@@ -98,6 +98,17 @@ local function run_in_split(worktree, args, conf)
end
end
-- `cat-file -p <sha>` routes to the gitobject viewer so commits get
-- the full message + diff view and other types render via cat-file.
-- Other modes (-t, -s, -e) fall through to the generic dump.
if args[1] == "cat-file" and vim.list_contains(args, "-p") then
local ref = first_positional(args, 2)
if ref then
require("git.object").open_object(worktree, ref)
return
end
end
local buf = git.new_scratch()
vim.b[buf].git_worktree = worktree
if conf.needs_ref then