Provide utility function to expire cached config

This is primarily for troubleshooting, but might also be handy for
users of includeIf.
This commit is contained in:
Tim Pope
2021-08-26 11:10:39 -04:00
parent 126363be5a
commit 46a2f58e1d

View File

@@ -954,6 +954,17 @@ endfunction
let s:config_prototype = {} let s:config_prototype = {}
let s:config = {} let s:config = {}
function! fugitive#ExpireConfig(...) abort
if !a:0 || a:1 is# 0
let s:config = {}
else
let key = a:1 is# '' ? '_' : s:GitDir(a:0 ? a:1 : -1)
if len(key) && has_key(s:config, key)
call remove(s:config, key)
endif
endif
endfunction
function! fugitive#Config(...) abort function! fugitive#Config(...) abort
let name = '' let name = ''
let default = get(a:, 3, '') let default = get(a:, 3, '')
@@ -3897,7 +3908,7 @@ if !exists('s:last_times')
endif endif
function! s:ExpireStatus(bufnr) abort function! s:ExpireStatus(bufnr) abort
if a:bufnr is# -2 if a:bufnr is# -2 || a:bufnr is# 0
let s:head_cache = {} let s:head_cache = {}
let s:last_time = reltime() let s:last_time = reltime()
return '' return ''