Handle git --version with (Apple ...) suffix

References https://github.com/tpope/vim-fugitive/issues/1194
This commit is contained in:
Tim Pope
2019-02-06 15:19:37 -05:00
parent ed07f9a503
commit 8899468c09

View File

@@ -181,7 +181,7 @@ endfunction
let s:git_versions = {} let s:git_versions = {}
function! fugitive#GitVersion(...) abort function! fugitive#GitVersion(...) abort
if !has_key(s:git_versions, g:fugitive_git_executable) if !has_key(s:git_versions, g:fugitive_git_executable)
let s:git_versions[g:fugitive_git_executable] = matchstr(system(g:fugitive_git_executable.' --version'), "\\S\\+\\ze\n") let s:git_versions[g:fugitive_git_executable] = matchstr(system(g:fugitive_git_executable.' --version'), '\d\S\+')
endif endif
if !a:0 if !a:0
return s:git_versions[g:fugitive_git_executable] return s:git_versions[g:fugitive_git_executable]