Merge pull request #577 from qstrahl/master
Don't wipe out b:airline_head if fugitive finds the head
This commit is contained in:
commit
ad19d1a10f
@ -42,9 +42,11 @@ function! airline#extensions#branch#head()
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
let b:airline_head = ''
|
let b:airline_head = ''
|
||||||
|
let found_fugitive_head = 0
|
||||||
|
|
||||||
if s:has_fugitive && !exists('b:mercurial_dir')
|
if s:has_fugitive && !exists('b:mercurial_dir')
|
||||||
let b:airline_head = fugitive#head(7)
|
let b:airline_head = fugitive#head(7)
|
||||||
|
let found_fugitive_head = 1
|
||||||
|
|
||||||
if empty(b:airline_head) && !exists('b:git_dir')
|
if empty(b:airline_head) && !exists('b:git_dir')
|
||||||
let b:airline_head = s:get_git_branch(expand("%:p:h"))
|
let b:airline_head = s:get_git_branch(expand("%:p:h"))
|
||||||
@ -66,7 +68,7 @@ function! airline#extensions#branch#head()
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if empty(b:airline_head) || !s:check_in_path()
|
if empty(b:airline_head) || !found_fugitive_head && !s:check_in_path()
|
||||||
let b:airline_head = ''
|
let b:airline_head = ''
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user