Encourage FugitiveFind() over FugitiveGitDir()

This commit is contained in:
Tim Pope
2021-07-30 14:08:18 -04:00
parent 24fd3d9599
commit 7a087725ee

View File

@@ -13,7 +13,8 @@ let s:bad_git_dir = '/$\|^fugitive:'
" FugitiveGitDir() returns the detected Git dir for the given buffer number, " FugitiveGitDir() returns the detected Git dir for the given buffer number,
" or the current buffer if no argument is passed. This will be an empty " or the current buffer if no argument is passed. This will be an empty
" string if no Git dir was found. Use !empty(FugitiveGitDir()) to check if " string if no Git dir was found. Use !empty(FugitiveGitDir()) to check if
" Fugitive is active in the current buffer. " Fugitive is active in the current buffer. Do not rely on this for direct
" filesystem access; use FugitiveFind('.git/whatever') instead.
function! FugitiveGitDir(...) abort function! FugitiveGitDir(...) abort
if v:version < 704 if v:version < 704
return '' return ''