diff options
author | Freed-Wu <Wuzy01@qq.com> | 2020-06-05 08:12:56 +0800 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2020-06-05 07:28:30 +0200 |
commit | 47b6900c425614d4ba22223c13a23920f0618d9f (patch) | |
tree | affe4ddcf23cbad9808fba756227951a3cd79c75 | |
parent | use git config to get email and name of user (diff) | |
download | gentoo-syntax-47b6900c425614d4ba22223c13a23920f0618d9f.tar.gz gentoo-syntax-47b6900c425614d4ba22223c13a23920f0618d9f.tar.bz2 gentoo-syntax-47b6900c425614d4ba22223c13a23920f0618d9f.zip |
Fix error when executable('git') == 1
Closes: https://github.com/gentoo/gentoo-syntax/pull/30
Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r-- | plugin/gentoo-common.vim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugin/gentoo-common.vim b/plugin/gentoo-common.vim index a0fe9cc..a15636a 100644 --- a/plugin/gentoo-common.vim +++ b/plugin/gentoo-common.vim @@ -13,8 +13,8 @@ let g:loaded_gentoo_common=1 fun! GentooGetUser() let l:result = expand("\$ECHANGELOG_USER") if l:result ==# "\$ECHANGELOG_USER" - let l:email = system('git config --global user.email') - let l:name = system('git config --global user.name') + let l:email = executable('git') ? system('git config --global user.email') : expand('$HOST') + let l:name = executable('git') ? system('git config --global user.name') : expand('$USER') let l:result = l:name . ' <' . l:email . '>' endif return l:result |