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

View File

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