check for existence of git/hg before calling them

This commit is contained in:
Christian Brabandt 2016-09-28 22:00:53 +02:00
parent f706edee9f
commit c39e5f82cc
1 changed files with 2 additions and 2 deletions

View File

@ -71,7 +71,7 @@ function! s:get_git_branch(path)
endfunction endfunction
function! s:get_git_untracked(file) function! s:get_git_untracked(file)
if empty(a:file) if empty(a:file) || !executable('git')
return return
endif endif
if !has_key(s:untracked_git, a:file) if !has_key(s:untracked_git, a:file)
@ -88,7 +88,7 @@ function! s:get_git_untracked(file)
endfunction endfunction
function! s:get_hg_untracked(file) function! s:get_hg_untracked(file)
if !s:has_lawrencium && empty(a:file) if !s:has_lawrencium || empty(a:file) || !executable('hg')
return return
endif endif
" delete cache when unlet b:airline head? " delete cache when unlet b:airline head?