Cache config queries

Does not support includeIf directives or a system config outside of
/etc/gitconfig for cache expiration.
This commit is contained in:
Tim Pope
2018-12-19 14:15:55 -05:00
parent c98daaacfe
commit d48fc4a5ec
2 changed files with 50 additions and 6 deletions

View File

@@ -72,8 +72,14 @@ function! FugitivePrepare(...) abort
return call('fugitive#Prepare', a:000)
endfunction
function! FugitiveConfig(key, ...) abort
return fugitive#Config(a:key, FugitiveGitDir(a:0 ? a:1 : -1))
function! FugitiveConfig(...) abort
if len(a:000) == 2
return fugitive#Config(a:000[1], FugitiveGitDir(a:000[2]))
elseif len(a:000) == 1 && a:000[0] !~# '^[[:alnum:]-]\+\.'
return fugitive#Config(FugitiveGitDir(a:000[0]))
else
return call('fugitive#Config', a:000)
endif
endfunction
function! FugitiveRemoteUrl(...) abort