소스 검색

Do not proceed if $GIT_DIR or $GIT_WORK_TREE is found

Close #506
Junegunn Choi 9 년 전
부모
커밋
5695fb8474
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      plug.vim

+ 6 - 0
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