Mercurial > vim
comparison autoload/plug.vim.old @ 4:1a705d7a7521
working on stuff
| author | luka |
|---|---|
| date | Thu, 23 Oct 2025 12:33:51 -0400 |
| parents | a4ec03f77554 |
| children |
comparison
equal
deleted
inserted
replaced
| 3:951569ccb9c7 | 4:1a705d7a7521 |
|---|---|
| 1073 | 1073 |
| 1074 function! s:hash_match(a, b) | 1074 function! s:hash_match(a, b) |
| 1075 return stridx(a:a, a:b) == 0 || stridx(a:b, a:a) == 0 | 1075 return stridx(a:a, a:b) == 0 || stridx(a:b, a:a) == 0 |
| 1076 endfunction | 1076 endfunction |
| 1077 | 1077 |
| 1078 function! s:disable_credential_helper() | |
| 1079 return s:git_version_requirement(2) && get(g:, 'plug_disable_credential_helper', 1) | |
| 1080 endfunction | |
| 1081 | |
| 1078 function! s:checkout(spec) | 1082 function! s:checkout(spec) |
| 1079 let sha = a:spec.commit | 1083 let sha = a:spec.commit |
| 1080 let output = s:git_revision(a:spec.dir) | 1084 let output = s:git_revision(a:spec.dir) |
| 1081 let error = 0 | 1085 let error = 0 |
| 1082 if !empty(output) && !s:hash_match(sha, s:lines(output)[0]) | 1086 if !empty(output) && !s:hash_match(sha, s:lines(output)[0]) |
| 1083 let credential_helper = s:git_version_requirement(2) ? '-c credential.helper= ' : '' | 1087 let credential_helper = s:disable_credential_helper() ? '-c credential.helper= ' : '' |
| 1084 let output = s:system( | 1088 let output = s:system( |
| 1085 \ 'git '.credential_helper.'fetch --depth 999999 && git checkout '.plug#shellescape(sha).' --', a:spec.dir) | 1089 \ 'git '.credential_helper.'fetch --depth 999999 && git checkout '.plug#shellescape(sha).' --', a:spec.dir) |
| 1086 let error = v:shell_error | 1090 let error = v:shell_error |
| 1087 endif | 1091 endif |
| 1088 return [output, error] | 1092 return [output, error] |
| 1587 call s:spawn(name, spec, queue, { 'dir': spec.dir }) | 1591 call s:spawn(name, spec, queue, { 'dir': spec.dir }) |
| 1588 elseif !new | 1592 elseif !new |
| 1589 let [error, _] = s:git_validate(spec, 0) | 1593 let [error, _] = s:git_validate(spec, 0) |
| 1590 if empty(error) | 1594 if empty(error) |
| 1591 if pull | 1595 if pull |
| 1592 let cmd = s:git_version_requirement(2) ? ['git', '-c', 'credential.helper=', 'fetch'] : ['git', 'fetch'] | 1596 let cmd = s:disable_credential_helper() ? ['git', '-c', 'credential.helper=', 'fetch'] : ['git', 'fetch'] |
| 1593 if has_tag && !empty(globpath(spec.dir, '.git/shallow')) | 1597 if has_tag && !empty(globpath(spec.dir, '.git/shallow')) |
| 1594 call extend(cmd, ['--depth', '99999999']) | 1598 call extend(cmd, ['--depth', '99999999']) |
| 1595 endif | 1599 endif |
| 1596 if !empty(prog) | 1600 if !empty(prog) |
| 1597 call add(cmd, prog) | 1601 call add(cmd, prog) |
