mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-10 20:43:46 -05:00
Add ability to query current Git version
This commit is contained in:
@@ -64,6 +64,15 @@ function! s:shellslash(path)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
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()
|
function! s:recall()
|
||||||
let rev = s:sub(s:buffer().rev(), '^/', '')
|
let rev = s:sub(s:buffer().rev(), '^/', '')
|
||||||
if rev ==# ':'
|
if rev ==# ':'
|
||||||
|
|||||||
Reference in New Issue
Block a user