mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-13 13:53:51 -05:00
Support GitHub FI
This commit is contained in:
@@ -1758,11 +1758,15 @@ endfunction
|
||||
|
||||
function! s:github_url(repo,url,rev,commit,path,type,line1,line2) abort
|
||||
let path = a:path
|
||||
let repo_path = matchstr(a:url,'^\%(https\=://\|git://\|git@\)github\.com[/:]\zs.\{-\}\ze\%(\.git\)\=$')
|
||||
if repo_path ==# ''
|
||||
let domain_pattern = 'github\.com'
|
||||
for domain in exists('g:fugitive_github_domains') ? g:fugitive_github_domains : []
|
||||
let domain_pattern .= '\|' . escape(domain, '.')
|
||||
endfor
|
||||
let repo = matchstr(a:url,'^\%(https\=://\|git://\|git@\)\zs\('.domain_pattern.'\)[/:].\{-\}\ze\%(\.git\)\=$')
|
||||
if repo ==# ''
|
||||
return ''
|
||||
endif
|
||||
let root = 'https://github.com/' . repo_path
|
||||
let root = 'https://' . s:sub(repo,':','/')
|
||||
if path =~# '^\.git/refs/heads/'
|
||||
let branch = a:repo.git_chomp('config','branch.'.path[16:-1].'.merge')[11:-1]
|
||||
if branch ==# ''
|
||||
|
||||
Reference in New Issue
Block a user