802 syntax region plug1 start=/\%1l/ end=/\%2l/ contains=plugNumber |
802 syntax region plug1 start=/\%1l/ end=/\%2l/ contains=plugNumber |
803 syntax region plug2 start=/\%2l/ end=/\%3l/ contains=plugBracket,plugX |
803 syntax region plug2 start=/\%2l/ end=/\%3l/ contains=plugBracket,plugX |
804 syn match plugNumber /[0-9]\+[0-9.]*/ contained |
804 syn match plugNumber /[0-9]\+[0-9.]*/ contained |
805 syn match plugBracket /[[\]]/ contained |
805 syn match plugBracket /[[\]]/ contained |
806 syn match plugX /x/ contained |
806 syn match plugX /x/ contained |
807 syn match plugDash /^-/ |
807 syn match plugDash /^-\{1}\ / |
808 syn match plugPlus /^+/ |
808 syn match plugPlus /^+/ |
809 syn match plugStar /^*/ |
809 syn match plugStar /^*/ |
810 syn match plugMessage /\(^- \)\@<=.*/ |
810 syn match plugMessage /\(^- \)\@<=.*/ |
811 syn match plugName /\(^- \)\@<=[^ ]*:/ |
811 syn match plugName /\(^- \)\@<=[^ ]*:/ |
812 syn match plugSha /\%(: \)\@<=[0-9a-f]\{4,}$/ |
812 syn match plugSha /\%(: \)\@<=[0-9a-f]\{4,}$/ |
820 syn match plugRelDate /([^)]*)$/ contained |
820 syn match plugRelDate /([^)]*)$/ contained |
821 syn match plugNotLoaded /(not loaded)$/ |
821 syn match plugNotLoaded /(not loaded)$/ |
822 syn match plugError /^x.*/ |
822 syn match plugError /^x.*/ |
823 syn region plugDeleted start=/^\~ .*/ end=/^\ze\S/ |
823 syn region plugDeleted start=/^\~ .*/ end=/^\ze\S/ |
824 syn match plugH2 /^.*:\n-\+$/ |
824 syn match plugH2 /^.*:\n-\+$/ |
|
825 syn match plugH2 /^-\{2,}/ |
825 syn keyword Function PlugInstall PlugStatus PlugUpdate PlugClean |
826 syn keyword Function PlugInstall PlugStatus PlugUpdate PlugClean |
826 hi def link plug1 Title |
827 hi def link plug1 Title |
827 hi def link plug2 Repeat |
828 hi def link plug2 Repeat |
828 hi def link plugH2 Type |
829 hi def link plugH2 Type |
829 hi def link plugX Exception |
830 hi def link plugX Exception |
1075 |
1076 |
1076 function! s:checkout(spec) |
1077 function! s:checkout(spec) |
1077 let sha = a:spec.commit |
1078 let sha = a:spec.commit |
1078 let output = s:git_revision(a:spec.dir) |
1079 let output = s:git_revision(a:spec.dir) |
1079 if !empty(output) && !s:hash_match(sha, s:lines(output)[0]) |
1080 if !empty(output) && !s:hash_match(sha, s:lines(output)[0]) |
|
1081 let credential_helper = s:git_version_requirement(2) ? '-c credential.helper= ' : '' |
1080 let output = s:system( |
1082 let output = s:system( |
1081 \ 'git fetch --depth 999999 && git checkout '.plug#shellescape(sha).' --', a:spec.dir) |
1083 \ 'git '.credential_helper.'fetch --depth 999999 && git checkout '.plug#shellescape(sha).' --', a:spec.dir) |
1082 endif |
1084 endif |
1083 return output |
1085 return output |
1084 endfunction |
1086 endfunction |
1085 |
1087 |
1086 function! s:finish(pull) |
1088 function! s:finish(pull) |
1528 let has_tag = has_key(spec, 'tag') |
1530 let has_tag = has_key(spec, 'tag') |
1529 if !new |
1531 if !new |
1530 let [error, _] = s:git_validate(spec, 0) |
1532 let [error, _] = s:git_validate(spec, 0) |
1531 if empty(error) |
1533 if empty(error) |
1532 if pull |
1534 if pull |
1533 let cmd = ['git', 'fetch'] |
1535 let cmd = s:git_version_requirement(2) ? ['git', '-c', 'credential.helper=', 'fetch'] : ['git', 'fetch'] |
1534 if has_tag && !empty(globpath(spec.dir, '.git/shallow')) |
1536 if has_tag && !empty(globpath(spec.dir, '.git/shallow')) |
1535 call extend(cmd, ['--depth', '99999999']) |
1537 call extend(cmd, ['--depth', '99999999']) |
1536 endif |
1538 endif |
1537 if !empty(prog) |
1539 if !empty(prog) |
1538 call add(cmd, prog) |
1540 call add(cmd, prog) |