From 0648abc018853539df111dac963930f7e40ac9d7 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Mon, 29 May 2017 21:17:20 -0400 Subject: [PATCH] Fix regexp checking Git version in :Gbrowse References https://github.com/tpope/vim-fugitive/issues/844 --- plugin/fugitive.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index b962a7a..a1776ed 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -1834,6 +1834,7 @@ function! s:Diff(vert,keepfocus,...) abort else let file = s:buffer().expand(arg) endif + throw file if file !~# ':' && file !~# '^/' && s:repo().git_chomp('cat-file','-t',file) =~# '^\%(tag\|commit\)$' let file = file.s:buffer().path(':') endif @@ -2332,7 +2333,7 @@ function! s:Browse(bang,line1,count,...) abort else let remote_for_url = remote endif - if fugitive#git_version() =~# '^[01]\.|^2\.[0-6]\.' + 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)