Provide config functions globally

This makes it easier to check for them with exists().
This commit is contained in:
Tim Pope 2018-07-22 13:40:47 -04:00
parent c472b8f2c1
commit 382c0a5405
2 changed files with 12 additions and 4 deletions

View File

@ -2641,13 +2641,13 @@ function! s:Browse(bang,line1,count,...) abort
let branch = s:repo().head()
endif
if !empty(branch)
let r = s:repo().git_chomp('config','branch.'.branch.'.remote')
let m = s:repo().git_chomp('config','branch.'.branch.'.merge')[11:-1]
let r = fugitive#Config('branch.'.branch.'.remote')
let m = fugitive#Config('branch.'.branch.'.merge')[11:-1]
if r ==# '.' && !empty(m)
let r2 = s:repo().git_chomp('config','branch.'.m.'.remote')
let r2 = fugitive#Config('branch.'.m.'.remote')
if r2 !~# '^\.\=$'
let r = r2
let m = s:repo().git_chomp('config','branch.'.m.'.merge')[11:-1]
let m = fugitive#Config('branch.'.m.'.merge')[11:-1]
endif
endif
if empty(remote)

View File

@ -168,6 +168,14 @@ function! FugitiveParse(...) abort
throw v:errmsg
endfunction
function! FugitiveConfig(...) abort
return call('fugitive#Config', a:000)
endfunction
function! FugitiveRemoteUrl(...) abort
return call('fugitive#RemoteUrl', a:000)
endfunction
augroup fugitive
autocmd!