From 5695fb84743ace811c03a5cd39ca7a825fa9caf7 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sat, 23 Jul 2016 10:13:25 +0900 Subject: [PATCH] Do not proceed if $GIT_DIR or $GIT_WORK_TREE is found Close #506 --- plug.vim | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plug.vim b/plug.vim index 866db9c..ff1827b 100644 --- a/plug.vim +++ b/plug.vim @@ -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