Support :tcd in initialization

This commit is contained in:
Tim Pope 2019-06-30 21:11:31 -04:00
parent 4a94b374d0
commit 384c9e1d8e

View File

@ -159,7 +159,7 @@ function! FugitiveExtractGitDir(path) abort
endif endif
let root = resolve(path) let root = resolve(path)
if root !=# path if root !=# path
silent! exe haslocaldir() ? 'lcd .' : 'cd .' silent! exe (haslocaldir() ? 'lcd' : exists(':tcd') && haslocaldir(-1) ? 'tcd' : 'cd') '.'
endif endif
let previous = "" let previous = ""
let env_git_dir = len($GIT_DIR) ? s:Slash(simplify(fnamemodify($GIT_DIR, ':p:s?[\/]$??'))) : '' let env_git_dir = len($GIT_DIR) ? s:Slash(simplify(fnamemodify($GIT_DIR, ':p:s?[\/]$??'))) : ''