Revert "Remove guard against index stage in :Gbrowse handler"
This reverts commit 14daf094d90fe713186881323d41190420bb6319. 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:
parent
52d180af0a
commit
bf04261080
@ -2336,7 +2336,11 @@ 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.repo.rev_parse('HEAD')
|
||||||
|
else
|
||||||
let commit = a:opts.commit
|
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 =~# '[^/]$'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user