From 382c0a54054467e72840a09484c2b79c6ad13c46 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sun, 22 Jul 2018 13:40:47 -0400 Subject: [PATCH] Provide config functions globally This makes it easier to check for them with exists(). --- autoload/fugitive.vim | 8 ++++---- plugin/fugitive.vim | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 6ddc858..eee8d4c 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -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) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 00b6910..0ce9246 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -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!