mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-16 23:33:43 -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)
|
if empty(dir)
|
||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
let file = fugitive#Find('.git/HEAD', dir)
|
let file = FugitiveActualDir() . '/HEAD'
|
||||||
let ftime = getftime(file)
|
let ftime = getftime(file)
|
||||||
if ftime == -1
|
if ftime == -1
|
||||||
return ''
|
return ''
|
||||||
@@ -7904,7 +7904,7 @@ function! fugitive#Statusline(...) abort
|
|||||||
if len(commit)
|
if len(commit)
|
||||||
let status .= ':' . commit[0:6]
|
let status .= ':' . commit[0:6]
|
||||||
endif
|
endif
|
||||||
let status .= '('.FugitiveHead(7, dir).')'
|
let status .= '('.fugitive#Head(7, dir).')'
|
||||||
return '[Git'.status.']'
|
return '[Git'.status.']'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user