Fix Lazygit file history when cwd is outside the repo

This commit is contained in:
Roey Darwish Dror 2024-10-29 23:53:18 +02:00
parent 12818a6cb4
commit 79f74abd60

View file

@ -137,7 +137,7 @@ map("n", "<leader>gB", LazyVim.lazygit.browse, { desc = "Git Browse" })
map("n", "<leader>gf", function() map("n", "<leader>gf", function()
local git_path = vim.api.nvim_buf_get_name(0) local git_path = vim.api.nvim_buf_get_name(0)
LazyVim.lazygit({args = { "-f", vim.trim(git_path) }}) LazyVim.lazygit({args = { "-f", vim.trim(git_path) }, cwd = LazyVim.root.git()})
end, { desc = "Lazygit Current File History" }) end, { desc = "Lazygit Current File History" })
map("n", "<leader>gl", function() map("n", "<leader>gl", function()