diff --git a/lua/nvim-tree/git/utils.lua b/lua/nvim-tree/git/utils.lua index f0940ef78e7..b7e67c9a336 100644 --- a/lua/nvim-tree/git/utils.lua +++ b/lua/nvim-tree/git/utils.lua @@ -25,7 +25,7 @@ function M.get_toplevel(cwd) if vim.fn.has "win32" == 1 then -- msys2 git support if has_cygpath then - toplevel = vim.fn.system("cygpath -w " .. vim.fn.shellescape(toplevel)) + toplevel = vim.fn.system("cygpath -w " .. vim.fn.shellescape(toplevel:sub(0, -2))) if vim.v.shell_error ~= 0 then return nil end