We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 540c811 commit 6abc87bCopy full SHA for 6abc87b
lua/nvim-tree/git/utils.lua
@@ -1,5 +1,7 @@
1
local M = {}
2
3
+local has_cygpath = vim.fn.executable "cygpath" == 1
4
+
5
function M.get_toplevel(cwd)
6
local cmd = "git -C " .. vim.fn.shellescape(cwd) .. " rev-parse --show-toplevel"
7
local toplevel = vim.fn.system(cmd)
@@ -10,6 +12,10 @@ function M.get_toplevel(cwd)
10
12
11
13
-- git always returns path with forward slashes
14
if vim.fn.has "win32" == 1 then
15
+ -- msys2 git support
16
+ if has_cygpath then
17
+ toplevel = vim.fn.system("cygpath -w " .. vim.fn.shellescape(toplevel))
18
+ end
19
toplevel = toplevel:gsub("/", "\\")
20
end
21
0 commit comments