feat(git): route :G cat-file -p <sha> through the object viewer
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user