mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-17 07:43:44 -05:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user