Fix determining Git version with custom Git command

Resolves: https://github.com/tpope/vim-fugitive/issues/1801
This commit is contained in:
Tim Pope
2021-07-29 08:24:12 -04:00
parent 11aee0ba82
commit 058ffa406d

View File

@@ -321,7 +321,7 @@ let s:git_versions = {}
function! fugitive#GitVersion(...) abort function! fugitive#GitVersion(...) abort
let git = s:GitShellCmd() let git = s:GitShellCmd()
if !has_key(s:git_versions, git) if !has_key(s:git_versions, git)
let s:git_versions[git] = matchstr(s:SystemError([git, '--version'])[0], '\d[^[:space:]]\+') let s:git_versions[git] = matchstr(s:SystemError(s:GitCmd() + ['--version'])[0], '\d[^[:space:]]\+')
endif endif
if !a:0 if !a:0
return s:git_versions[git] return s:git_versions[git]