Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lua/lazy/view/diff.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ M.handlers = {

---@type LazyDiffFun
["diffview.nvim"] = function(plugin, diff)
local args
local args = "--git-dir=.git" .. " " .. ("-C=%s"):format(plugin.dir) .. " "
if diff.commit then
args = ("-C=%s"):format(plugin.dir) .. " " .. diff.commit .. "^!"
args = args .. diff.commit .. "^!"
else
args = ("-C=%s"):format(plugin.dir) .. " " .. diff.from .. ".." .. diff.to
args = args .. diff.from .. ".." .. diff.to
end
vim.cmd("DiffviewOpen " .. args)
end,

---@type LazyDiffFun
git = function(plugin, diff)
local cmd = { "git" }
local cmd = { "git", "--git-dir=.git" }
if diff.commit then
cmd[#cmd + 1] = "show"
cmd[#cmd + 1] = diff.commit
Expand All @@ -48,7 +48,7 @@ M.handlers = {

---@type LazyDiffFun
terminal_git = function(plugin, diff)
local cmd = { "git" }
local cmd = { "git", "--git-dir=.git" }
if diff.commit then
cmd[#cmd + 1] = "show"
cmd[#cmd + 1] = diff.commit
Expand Down