mirror of
https://github.com/tpope/vim-fugitive.git
synced 2026-10-07 12:44:39 +08:00
Add ability to query current Git version
This commit is contained in:
1 parent
050b22e531
commit
dc250fcc8d
1 file changed
+9
@@ -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 ==# ':'
|
||||
|
||||
Reference in new issue
Block a user