From 596621dc6efdb5df8acbc2be5d8b739018fb947d Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Mon, 30 May 2022 16:39:06 -0400 Subject: [PATCH] Support Git for Windows bundled MSYS Vim References: https://github.com/tpope/vim-fugitive/issues/1970 --- plugin/fugitive.vim | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 5643500..23ceb97 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -526,9 +526,15 @@ else return a:path endfunction - function! FugitiveVimPath(path) abort - return a:path - endfunction + if has('win32unix') && filereadable('/git-bash.exe') + function! FugitiveVimPath(path) abort + return substitute(a:path, '^\(\a\):', '/\l\1', '') + endfunction + else + function! FugitiveVimPath(path) abort + return a:path + endfunction + endif endif