Do not proceed if $GIT_DIR or $GIT_WORK_TREE is found

Close #506
This commit is contained in:
Junegunn Choi 2016-07-23 10:13:25 +09:00
parent f68a4fddae
commit 5695fb8474
No known key found for this signature in database
GPG key ID: 254BC280FEF9C627

View file

@ -705,6 +705,12 @@ function! s:prepare(...)
throw 'Invalid current working directory. Cannot proceed.' throw 'Invalid current working directory. Cannot proceed.'
endif endif
for evar in ['$GIT_DIR', '$GIT_WORK_TREE']
if exists(evar)
throw evar.' detected. Cannot proceed.'
endif
endfor
call s:job_abort() call s:job_abort()
if s:switch_in() if s:switch_in()
normal q normal q