From b43ace1ecfbeb87626fbde8973a2717247471b2e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 29 Jun 2024 15:37:26 +0200 Subject: [PATCH] fix(git): use current dir when git not found to get a meaningful error message --- lua/lazyvim/util/lazygit.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/lazygit.lua b/lua/lazyvim/util/lazygit.lua index 630d009a..2e030cb6 100644 --- a/lua/lazyvim/util/lazygit.lua +++ b/lua/lazyvim/util/lazygit.lua @@ -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