From eb945e9a114a973073a206202bd0d5df851a5193 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Mon, 3 Apr 2017 17:18:20 -0400 Subject: [PATCH] :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. --- plugin/fugitive.vim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index d534263..06de556 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -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')