Make FugitiveChanged event aware of :Git result

If g:fugitive_result is defined during the User FugitiveChanged event,
one can trigger a custom behavior based on the arguments in .args or the
output in .file.

References https://github.com/tpope/vim-fugitive/pull/1015
This commit is contained in:
Tim Pope
2021-03-29 19:33:36 -04:00
parent a1cb01da5b
commit 002ed8de2e
2 changed files with 16 additions and 6 deletions

View File

@@ -22,6 +22,8 @@ function! FugitiveGitDir(...) abort
return getbufvar(a:1, 'git_dir')
elseif type(a:1) == type('')
return substitute(s:Slash(a:1), '/$', '', '')
elseif type(a:1) == type({})
return get(a:1, 'git_dir', '')
else
return ''
endif