Fix FugitiveIsGitDir()

This commit is contained in:
Tim Pope
2021-08-08 05:03:11 -04:00
parent 89c9f96d49
commit dfae8191f4

View File

@@ -231,11 +231,11 @@ function! FugitiveWorkTree(...) abort
endfunction endfunction
function! FugitiveIsGitDir(...) abort function! FugitiveIsGitDir(...) abort
if !a:0 || type(a:1) !=# '' if !a:0 || type(a:1) !=# type('')
return !empty(call('FugitiveGitDir', a:000)) return !empty(call('FugitiveGitDir', a:000))
endif endif
let path = substitute(a:1, '[\/]$', '', '') . '/' let path = substitute(a:1, '[\/]$', '', '') . '/'
return len(a:path) && getfsize(path.'HEAD') > 10 && ( return len(path) && getfsize(path.'HEAD') > 10 && (
\ isdirectory(path.'objects') && isdirectory(path.'refs') || \ isdirectory(path.'objects') && isdirectory(path.'refs') ||
\ getftype(path.'commondir') ==# 'file') \ getftype(path.'commondir') ==# 'file')
endfunction endfunction