motiejus/dotfiles

Unnamed repository; edit this file 'description' to name the repository.
git clone https://git.jakstys.lt/motiejus/dotfiles.git
Log | Tree | Refs | README | LICENSE

commit dc250fcc8dc2e5a62247c9ab2f138625e8f14dab (tree)
parent 050b22e5318280c3736ddee3779e6a1c514c4a19
Author: Tim Pope <code@tpope.net>
Date:   Thu, 24 Oct 2013 00:15:40 -0400

Add ability to query current Git version

Diffstat:
Mplugin/fugitive.vim | 9+++++++++
1 file changed, 9 insertions(+), 0 deletions(-)

diff --git 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 ==# ':'