mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-13 13:53:51 -05:00
Leverage #head() in #statusline()
This commit is contained in:
@@ -2387,12 +2387,7 @@ function! fugitive#statusline(...)
|
|||||||
if s:buffer().commit() != ''
|
if s:buffer().commit() != ''
|
||||||
let status .= ':' . s:buffer().commit()[0:7]
|
let status .= ':' . s:buffer().commit()[0:7]
|
||||||
endif
|
endif
|
||||||
let head = s:repo().head_ref()
|
let status .= '('.fugitive#head(7).')'
|
||||||
if head =~# '^ref: '
|
|
||||||
let status .= s:sub(head,'^ref: %(refs/%(heads/|remotes/|tags/)=)=','(').')'
|
|
||||||
elseif head =~# '^\x\{40\}$'
|
|
||||||
let status .= '('.head[0:7].')'
|
|
||||||
endif
|
|
||||||
if &statusline =~# '%[MRHWY]' && &statusline !~# '%[mrhwy]'
|
if &statusline =~# '%[MRHWY]' && &statusline !~# '%[mrhwy]'
|
||||||
return ',GIT'.status
|
return ',GIT'.status
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user