refactor(git): URI scheme is now a git revspec, loaded via cat-file -p
This commit is contained in:
+2
-6
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user