mirror of
https://github.com/junegunn/vim-plug.git
synced 2024-12-19 10:35:38 -07:00
parent
e300178a0e
commit
93ab590978
4
plug.vim
4
plug.vim
@ -2766,9 +2766,9 @@ function! s:snapshot(force, ...) abort
|
|||||||
1
|
1
|
||||||
let anchor = line('$') - 3
|
let anchor = line('$') - 3
|
||||||
let names = sort(keys(filter(copy(g:plugs),
|
let names = sort(keys(filter(copy(g:plugs),
|
||||||
\'has_key(v:val, "uri") && !has_key(v:val, "commit") && isdirectory(v:val.dir)')))
|
\'has_key(v:val, "uri") && isdirectory(v:val.dir)')))
|
||||||
for name in reverse(names)
|
for name in reverse(names)
|
||||||
let sha = s:git_revision(g:plugs[name].dir)
|
let sha = has_key(g:plugs[name], 'commit') ? g:plugs[name].commit : s:git_revision(g:plugs[name].dir)
|
||||||
if !empty(sha)
|
if !empty(sha)
|
||||||
call append(anchor, printf("silent! let g:plugs['%s'].commit = '%s'", name, sha))
|
call append(anchor, printf("silent! let g:plugs['%s'].commit = '%s'", name, sha))
|
||||||
redraw
|
redraw
|
||||||
|
4
test/run
4
test/run
@ -62,7 +62,7 @@ EOF
|
|||||||
|
|
||||||
gitinit() (
|
gitinit() (
|
||||||
cd "$PLUG_FIXTURES/$1"
|
cd "$PLUG_FIXTURES/$1"
|
||||||
git init
|
git init -b master
|
||||||
git commit -m 'commit' --allow-empty
|
git commit -m 'commit' --allow-empty
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ DOC
|
|||||||
|
|
||||||
rm -rf $TEMP/new-branch
|
rm -rf $TEMP/new-branch
|
||||||
cd $TEMP
|
cd $TEMP
|
||||||
git init new-branch
|
git init new-branch -b master
|
||||||
cd new-branch
|
cd new-branch
|
||||||
mkdir plugin
|
mkdir plugin
|
||||||
echo 'let g:foo = 1' > plugin/foo.vim
|
echo 'let g:foo = 1' > plugin/foo.vim
|
||||||
|
@ -1620,10 +1620,12 @@ Execute (Commit hash support):
|
|||||||
Assert empty(mapcheck('X'))
|
Assert empty(mapcheck('X'))
|
||||||
Assert !empty(mapcheck("\<cr>"))
|
Assert !empty(mapcheck("\<cr>"))
|
||||||
|
|
||||||
" Nor in PlugSnapshot output
|
" The exact hash values in PlugSnapshot output
|
||||||
PlugSnapshot
|
PlugSnapshot
|
||||||
Log getline(1, '$')
|
Log getline(1, '$')
|
||||||
AssertEqual 8, line('$')
|
AssertEqual "silent! let g:plugs['goyo.vim'].commit = 'ffffffff'", getline(6)
|
||||||
|
AssertEqual "silent! let g:plugs['vim-emoji'].commit = '9db7fcfee0d90dafdbcb7a32090c0a9085eb054a'", getline(7)
|
||||||
|
AssertEqual 10, line('$')
|
||||||
q
|
q
|
||||||
|
|
||||||
Execute (Commit hash support - cleared):
|
Execute (Commit hash support - cleared):
|
||||||
|
Loading…
Reference in New Issue
Block a user