From 476fbd09508a3de1eddb76d74089392c5254aa53 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Mon, 7 May 2012 11:41:25 -0400 Subject: [PATCH] Leverage #head() in #statusline() --- plugin/fugitive.vim | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index d587e88..041c8be 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -2387,12 +2387,7 @@ function! fugitive#statusline(...) if s:buffer().commit() != '' let status .= ':' . s:buffer().commit()[0:7] endif - let head = s:repo().head_ref() - if head =~# '^ref: ' - let status .= s:sub(head,'^ref: %(refs/%(heads/|remotes/|tags/)=)=','(').')' - elseif head =~# '^\x\{40\}$' - let status .= '('.head[0:7].')' - endif + let status .= '('.fugitive#head(7).')' if &statusline =~# '%[MRHWY]' && &statusline !~# '%[mrhwy]' return ',GIT'.status else