From 207c643ea46860c84dad5c5ba7033779c15a7b96 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Fri, 11 Dec 2015 16:38:05 -0500 Subject: [PATCH] Bring GitHub handler in line with rhubarb.vim Closes https://github.com/tpope/vim-fugitive/issues/730 --- plugin/fugitive.vim | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index fcdc94b..f95af69 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -2322,27 +2322,21 @@ function! s:github_url(opts, ...) abort return root . '/commits/' . branch endif elseif path =~# '^\.git/refs/tags/' - return root . '/releases/tag/' . matchstr(path,'[^/]\+$') - elseif path =~# '^\.git/refs/.' - return root . '/commits/' . matchstr(path,'[^/]\+$') + return root . '/releases/tag/' . path[15:-1] + elseif path =~# '^\.git/refs/remotes/[^/]\+/.' + return root . '/commits/' . matchstr(path,'remotes/[^/]\+/\zs.*') elseif path =~# '.git/\%(config$\|hooks\>\)' return root . '/admin' elseif path =~# '^\.git\>' return root endif - if a:opts.revision =~# '^[[:alnum:]._-]\+:' - let commit = matchstr(a:opts.revision,'^[^:]*') - elseif a:opts.commit =~# '^\d\=$' - let local = matchstr(a:opts.repo.head_ref(),'\