From c39e5f82cc55ae8ecfe23ce7333228e3103f8e47 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Wed, 28 Sep 2016 22:00:53 +0200 Subject: [PATCH] check for existence of git/hg before calling them --- autoload/airline/extensions/branch.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/airline/extensions/branch.vim b/autoload/airline/extensions/branch.vim index a6c38da8..353dce85 100644 --- a/autoload/airline/extensions/branch.vim +++ b/autoload/airline/extensions/branch.vim @@ -71,7 +71,7 @@ function! s:get_git_branch(path) endfunction function! s:get_git_untracked(file) - if empty(a:file) + if empty(a:file) || !executable('git') return endif if !has_key(s:untracked_git, a:file) @@ -88,7 +88,7 @@ function! s:get_git_untracked(file) endfunction function! s:get_hg_untracked(file) - if !s:has_lawrencium && empty(a:file) + if !s:has_lawrencium || empty(a:file) || !executable('hg') return endif " delete cache when unlet b:airline head?