mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-04 06:57:34 +00:00
fix(diff): set --git-dir
argument to overwrite user defined workspace $GIT_DIR
This commit is contained in:
parent
6c3bda4aca
commit
fdf6783434
1 changed files with 5 additions and 5 deletions
|
@ -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
|
||||
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue