From 6d75255999c97792e0aac705f78c2a4265d928c5 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 1 Dec 2015 04:06:04 -0500 Subject: [PATCH] Open release page for tags on GitHub --- autoload/rhubarb.vim | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/autoload/rhubarb.vim b/autoload/rhubarb.vim index efa1036..525d3ae 100644 --- a/autoload/rhubarb.vim +++ b/autoload/rhubarb.vim @@ -199,6 +199,8 @@ function! rhubarb#fugitive_url(opts, ...) abort else return root . '/commits/' . branch endif + elseif path =~# '^\.git/refs/tags/' + return root . '/releases/tag/' . path[15:-1] elseif path =~# '^\.git/refs/.' return root . '/commits/' . matchstr(path,'[^/]\+$') elseif path =~# '.git/\%(config$\|hooks\>\)' @@ -226,9 +228,6 @@ function! rhubarb#fugitive_url(opts, ...) abort elseif get(a:opts, 'line2') let url .= '#L' . a:opts.line1 . '-L' . a:opts.line2 endif - elseif a:opts.type == 'tag' - let commit = matchstr(getline(3),'^tag \zs.*') - let url = root . '/tree/' . commit else let url = root . '/commit/' . commit endif