From 535389b9a64be18349394c192bcf0348c0dee64e Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 31 May 2022 14:24:47 -0400 Subject: [PATCH] Improve performance of FugitiveStatusline() Avoiding fugitive#Find() saves a millisecond or 2. Not a big deal but still worth avoiding given how often this function is called. --- autoload/fugitive.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index c4088a3..ffab278 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -956,7 +956,7 @@ function! fugitive#Head(...) abort if empty(dir) return '' endif - let file = fugitive#Find('.git/HEAD', dir) + let file = FugitiveActualDir() . '/HEAD' let ftime = getftime(file) if ftime == -1 return '' @@ -7904,7 +7904,7 @@ function! fugitive#Statusline(...) abort if len(commit) let status .= ':' . commit[0:6] endif - let status .= '('.FugitiveHead(7, dir).')' + let status .= '('.fugitive#Head(7, dir).')' return '[Git'.status.']' endfunction