diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 970d158..dafe109 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -108,7 +108,7 @@ function! s:ExtractGitDir(path) abort let ofn = "" let nfn = fn while fn != ofn - if isdirectory(fn . '/.git') + if filereadable(fn . '/.git/HEAD') return s:sub(simplify(fnamemodify(fn . '/.git',':p')),'\W$','') elseif fn =~ '\.git$' && filereadable(fn . '/HEAD') return s:sub(simplify(fnamemodify(fn,':p')),'\W$','')