Leverage another API for getting common dir

This commit is contained in:
Tim Pope
2018-08-19 16:56:01 -04:00
parent 6c529de83c
commit 70b9cfc749

View File

@@ -15,9 +15,11 @@ if get(g:, 'fugitive_git_command', 'git') ==# 'git' && executable('hub')
let g:fugitive_git_command = 'hub'
endif
function! s:config() abort
function! s:Config() abort
if exists('*FugitiveCommonDir')
let dir = FugitiveCommonDir()
elseif exists('*FugitiveRoute')
let dir = FugitiveRoute('.git/config')[0:-8]
else
let dir = get(b:, 'git_dir', '')
let common_dir = b:git_dir . '/commondir'
@@ -34,7 +36,7 @@ augroup rhubarb
\ if expand('%:p') =~# '\.git[\/].*MSG$' &&
\ exists('+omnifunc') &&
\ &omnifunc =~# '^\%(syntaxcomplete#Complete\)\=$' &&
\ !empty(filter(s:config(),
\ !empty(filter(s:Config(),
\ '!empty(rhubarb#homepage_for_url(matchstr(v:val, ''^\s*url\s*=\s*"\=\zs\S*'')))')) |
\ setlocal omnifunc=rhubarb#omnifunc |
\ endif