Skip to content

msys2 git support #1290

Closed
Closed
@bstaint

Description

@bstaint

Is your feature request related to a problem? Please describe.
msys2 git support

Describe the solution you'd like
msys git path like /e/Downloads/testc(E:\Downloads\testc)

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
patch:

diff --git a/lua/nvim-tree/git/utils.lua b/lua/nvim-tree/git/utils.lua
index 21f2c7f..cb28f8d 100644
--- a/lua/nvim-tree/git/utils.lua
+++ b/lua/nvim-tree/git/utils.lua
@@ -10,6 +10,10 @@ function M.get_toplevel(cwd)
 
   -- git always returns path with forward slashes
   if vim.fn.has "win32" == 1 then
+    -- msys2
+    if vim.fn.executable('cygpath') then
+        toplevel = vim.fn.system("cygpath -w " .. vim.fn.shellescape(toplevel))
+    end
     toplevel = toplevel:gsub("/", "\\")
   end

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR pleasenvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciatedfeature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions