:Gbrowse remote/branch should not resolve upstream

Old behavior: Follow remote/branch to local branch to upstream,
wherever that happens to live.

New behavior: Open branch at remote, without further resolution.
This commit is contained in:
Tim Pope
2017-04-03 17:18:20 -04:00
parent 90cbbf5854
commit eb945e9a11

View File

@@ -2260,10 +2260,11 @@ function! s:Browse(bang,line1,count,...) abort
if path =~# '^\.git/refs/remotes/.'
if empty(remote)
let remote = matchstr(path, '^\.git/refs/remotes/\zs[^/]\+')
let branch = matchstr(path, '^\.git/refs/remotes/[^/]\+/\zs.\+')
else
let merge = matchstr(path, '^\.git/refs/remotes/[^/]\+/\zs.\+')
let path = '.git/refs/heads/'.merge
endif
let merge = matchstr(path, '^\.git/refs/remotes/[^/]\+/\zs.\+')
let branch = ''
let path = '.git/refs/heads/'.merge
elseif path =~# '^\.git/refs/heads/.'
let branch = path[16:-1]
elseif !exists('branch')