Tighten handling of refs in :Gbrowse

This commit is contained in:
Tim Pope
2015-12-01 18:55:13 -05:00
parent ade3d07374
commit ba6057c101

View File

@@ -201,8 +201,8 @@ function! rhubarb#fugitive_url(opts, ...) abort
endif endif
elseif path =~# '^\.git/refs/tags/' elseif path =~# '^\.git/refs/tags/'
return root . '/releases/tag/' . path[15:-1] return root . '/releases/tag/' . path[15:-1]
elseif path =~# '^\.git/refs/.' elseif path =~# '^\.git/refs/remotes/[^/]\+/.'
return root . '/commits/' . matchstr(path,'[^/]\+$') return root . '/commits/' . matchstr(path,'remotes/[^/]\+/\zs.*')
elseif path =~# '.git/\%(config$\|hooks\>\)' elseif path =~# '.git/\%(config$\|hooks\>\)'
return root . '/admin' return root . '/admin'
elseif path =~# '^\.git\>' elseif path =~# '^\.git\>'