mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-14 14:23:51 -05:00
Revert "Remove guard against index stage in :Gbrowse handler"
This reverts commit 14daf094d9. My
assertion was wrong; commit will no longer be an index stage but it
still might be an empty string.
This commit is contained in:
@@ -2336,7 +2336,11 @@ function! s:github_url(opts, ...) abort
|
|||||||
elseif path =~# '^\.git\>'
|
elseif path =~# '^\.git\>'
|
||||||
return root
|
return root
|
||||||
endif
|
endif
|
||||||
let commit = a:opts.commit
|
if a:opts.commit =~# '^\d\=$'
|
||||||
|
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 get(a:opts, 'type', '') ==# 'blob' || a:opts.path =~# '[^/]$'
|
elseif get(a:opts, 'type', '') ==# 'blob' || a:opts.path =~# '[^/]$'
|
||||||
|
|||||||
Reference in New Issue
Block a user