Support default value as third FugitiveConfigGet() argument

This commit is contained in:
Tim Pope
2021-05-26 09:22:37 -04:00
parent bee78a418f
commit da8d532b1a
2 changed files with 5 additions and 4 deletions

View File

@@ -128,8 +128,8 @@ endfunction
" structure of the return value as it is not guaranteed. If you want a full
" dictionary of every config value, use FugitiveConfigGetRegexp('.*').
function! FugitiveConfig(...) abort
if a:0 == 2 && (type(a:2) != type({}) || has_key(a:2, 'git_dir'))
return fugitive#Config(a:1, FugitiveGitDir(a:2))
if a:0 >= 2 && (type(a:2) != type({}) || has_key(a:2, 'git_dir'))
return call('fugitive#Config', [a:1, FugitiveGitDir(a:2)] + a:000[2:-1])
elseif a:0 == 1 && (type(a:1) !=# type('') || a:1 !~# '^[[:alnum:]-]\+\.')
return fugitive#Config(FugitiveGitDir(a:1))
else