Remove guard against index stage in :Gbrowse handler

This parameter can now always be directly used within a URL, without any
sanity checking
This commit is contained in:
Tim Pope 2015-12-26 14:18:00 -05:00
parent ac904e806d
commit 14daf094d9

View File

@ -2333,11 +2333,7 @@ function! s:github_url(opts, ...) abort
elseif path =~# '^\.git\>' elseif path =~# '^\.git\>'
return root return root
endif endif
if a:opts.commit =~# '^\d\=$' let commit = a:opts.commit
let commit = a:opts.repo.rev_parse('HEAD')
else
let commit = a:opts.commit
endif
if get(a:opts, 'type', '') ==# 'tree' || a:opts.path =~# '/$' if get(a:opts, 'type', '') ==# 'tree' || a:opts.path =~# '/$'
let url = substitute(root . '/tree/' . commit . '/' . path, '/$', '', 'g') let url = substitute(root . '/tree/' . commit . '/' . path, '/$', '', 'g')
elseif a:opts.type == 'blob' elseif a:opts.type == 'blob'