Don't :cd if directory already correct
This commit is contained in:
parent
240127f5a5
commit
e6e3f3f225
@ -122,9 +122,11 @@ function! s:TreeChomp(...) abort
|
||||
try
|
||||
if !empty(tree)
|
||||
if fugitive#GitVersion() =~# '^[01]\..*'
|
||||
let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd' : 'cd'
|
||||
let cwd = getcwd()
|
||||
exe cd s:fnameescape(tree)
|
||||
if getcwd() !=# tree
|
||||
let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd' : 'cd'
|
||||
let cwd = getcwd()
|
||||
exe cd s:fnameescape(tree)
|
||||
endif
|
||||
else
|
||||
let args = ['-C', tree] + args
|
||||
endif
|
||||
|
Loading…
Reference in New Issue
Block a user