mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-15 06:43:51 -05:00
Fix HEAD cache expiry on FugitiveDidChange()
This commit is contained in:
@@ -4194,11 +4194,11 @@ function! s:ExpireStatus(bufnr) abort
|
|||||||
let s:last_time = reltime()
|
let s:last_time = reltime()
|
||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
let dir = s:Dir(a:bufnr)
|
let head_file = fugitive#Find('.git/HEAD', a:bufnr)
|
||||||
if len(dir)
|
if !empty(head_file)
|
||||||
let s:last_times[s:cpath(dir)] = reltime()
|
let s:last_times[s:Tree(a:bufnr) . '/'] = reltime()
|
||||||
if has_key(s:head_cache, dir)
|
if has_key(s:head_cache, head_file)
|
||||||
call remove(s:head_cache, dir)
|
call remove(s:head_cache, head_file)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
return ''
|
return ''
|
||||||
@@ -4214,7 +4214,7 @@ function! s:ReloadWinStatus(...) abort
|
|||||||
endif
|
endif
|
||||||
let t = b:fugitive_reltime
|
let t = b:fugitive_reltime
|
||||||
if reltimestr(reltime(s:last_time, t)) =~# '-\|\d\{10\}\.' ||
|
if reltimestr(reltime(s:last_time, t)) =~# '-\|\d\{10\}\.' ||
|
||||||
\ reltimestr(reltime(get(s:last_times, s:cpath(s:Dir()), t), t)) =~# '-\|\d\{10\}\.'
|
\ reltimestr(reltime(get(s:last_times, s:Tree() . '/', t), t)) =~# '-\|\d\{10\}\.'
|
||||||
exe s:ReloadStatusBuffer()
|
exe s:ReloadStatusBuffer()
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
Reference in New Issue
Block a user