refactor(git): URI scheme is now a git revspec, loaded via cat-file -p

This commit is contained in:
2026-04-28 13:20:38 +02:00
parent a0c87b9b7b
commit 68f2ad1b52
6 changed files with 55 additions and 56 deletions
+2 -6
View File
@@ -74,7 +74,7 @@ end
---@param path string
local function show_file_in_split(worktree, user_ref, path)
local label = repo.rev_parse(worktree, user_ref, true) or user_ref
local uri = "git://" .. label .. "//" .. path
local uri = "git://" .. label .. ":" .. path
local buf = vim.fn.bufadd(uri)
vim.b[buf].git_worktree = worktree
vim.cmd("split " .. vim.fn.fnameescape(uri))
@@ -119,11 +119,7 @@ local function run_in_split(worktree, args, conf)
vim.b[buf].git_parent_ref =
repo.rev_parse(worktree, user_ref .. "^", true)
end
pcall(
vim.api.nvim_buf_set_name,
buf,
"git://" .. (sha or user_ref) .. "//"
)
pcall(vim.api.nvim_buf_set_name, buf, "git://" .. (sha or user_ref))
vim.bo[buf].filetype = conf.ft
else
vim.bo[buf].filetype = conf.ft