From fbf89773b4721ae5b46ccded0ceeee861921b697 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Wed, 26 Apr 2017 13:05:13 -0400 Subject: [PATCH] Don't assume support for remote get-url References https://github.com/tpope/vim-fugitive/issues/844 --- plugin/fugitive.vim | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 3eadd82..751dc93 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -2313,9 +2313,14 @@ function! s:Browse(bang,line1,count,...) abort if empty(remote) let remote = '.' - let raw = s:repo().git_chomp('remote','get-url','origin') + let remote_for_url = 'origin' else - let raw = s:repo().git_chomp('remote','get-url',remote) + let remote_for_url = remote + endif + if fugitive#git_version() =~# '^[01]\.|^2\.[0-6]\.' + let raw = s:repo().git_chomp('config','remote.'.remote_for_url.'.url') + else + let raw = s:repo().git_chomp('remote','get-url',remote_for_url) endif if raw ==# '' let raw = remote