diff options
| author | Anton Bobov <anton@bobov.name> | 2025-03-20 17:22:26 +0500 |
|---|---|---|
| committer | Anton Bobov <anton@bobov.name> | 2025-05-02 22:02:43 +0500 |
| commit | 33c5de12f9fa34674c40a5bf1a7329c3abe13c7e (patch) | |
| tree | e75cb3e100d03b5f78c2718656ae24d8c6b25d5e | |
| parent | eb68dafd6ca3b4129415b7145c284ece522438dd (diff) | |
vim: vim-plug upgrade
| -rw-r--r-- | files/.vim/autoload/plug.vim | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/files/.vim/autoload/plug.vim b/files/.vim/autoload/plug.vim index 5c910ca..da854b4 100644 --- a/files/.vim/autoload/plug.vim +++ b/files/.vim/autoload/plug.vim @@ -1075,12 +1075,16 @@ function! s:hash_match(a, b) return stridx(a:a, a:b) == 0 || stridx(a:b, a:a) == 0 endfunction +function! s:disable_credential_helper() + return s:git_version_requirement(2) && get(g:, 'plug_disable_credential_helper', 1) +endfunction + function! s:checkout(spec) let sha = a:spec.commit let output = s:git_revision(a:spec.dir) let error = 0 if !empty(output) && !s:hash_match(sha, s:lines(output)[0]) - let credential_helper = s:git_version_requirement(2) ? '-c credential.helper= ' : '' + let credential_helper = s:disable_credential_helper() ? '-c credential.helper= ' : '' let output = s:system( \ 'git '.credential_helper.'fetch --depth 999999 && git checkout '.plug#shellescape(sha).' --', a:spec.dir) let error = v:shell_error @@ -1589,7 +1593,7 @@ while 1 " Without TCO, Vim stack is bound to explode let [error, _] = s:git_validate(spec, 0) if empty(error) if pull - let cmd = s:git_version_requirement(2) ? ['git', '-c', 'credential.helper=', 'fetch'] : ['git', 'fetch'] + let cmd = s:disable_credential_helper() ? ['git', '-c', 'credential.helper=', 'fetch'] : ['git', 'fetch'] if has_tag && !empty(globpath(spec.dir, '.git/shallow')) call extend(cmd, ['--depth', '99999999']) endif |
