diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 51e52d8..edbf54b 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -130,6 +130,12 @@ function! fugitive#extract_git_dir(path) abort let root = s:shellslash(simplify(fnamemodify(a:path, ':p:s?[\/]$??'))) let previous = "" while root !=# previous + if root =~# '\v^//%([^/]+/?)?$' + " This is for accessing network shares from Cygwin Vim. There won't be + " any git directory called //.git or //serverName/.git so let's avoid + " checking for them since such checks are extremely slow. + break + endif let dir = s:sub(root, '[\/]$', '') . '/.git' let type = getftype(dir) if type ==# 'dir' && fugitive#is_git_dir(dir)