fix(git): use current dir when git not found to get a meaningful error message
This commit is contained in:
@ -154,7 +154,7 @@ function M.blame_line(opts)
|
||||
local cursor = vim.api.nvim_win_get_cursor(0)
|
||||
local line = cursor[1]
|
||||
local file = vim.api.nvim_buf_get_name(0)
|
||||
local root = LazyVim.root.detectors.pattern(0, { ".git" })[1]
|
||||
local root = LazyVim.root.detectors.pattern(0, { ".git" })[1] or "."
|
||||
local cmd = { "git", "-C", root, "log", "-n", opts.count, "-u", "-L", line .. ",+1:" .. file }
|
||||
return require("lazy.util").float_cmd(cmd, opts)
|
||||
end
|
||||
|
Reference in New Issue
Block a user