diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 20405bf..8ede56f 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -64,6 +64,15 @@ function! s:shellslash(path) endif endfunction +let s:git_versions = {} + +function! fugitive#git_version(...) abort + 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\\+\n") + endif + return s:git_versions[g:fugitive_git_executable] +endfunction + function! s:recall() let rev = s:sub(s:buffer().rev(), '^/', '') if rev ==# ':'