Use git:: prefix to avoid password prompt on git 1.7 (#56)

This commit is contained in:
Junegunn Choi 2014-08-14 03:11:27 +09:00
parent c1bbbaf3ef
commit da24f714e0
2 changed files with 10 additions and 10 deletions

View File

@ -379,7 +379,7 @@ function! s:infer_properties(name, repo)
if repo !~ '/' if repo !~ '/'
let repo = 'vim-scripts/'. repo let repo = 'vim-scripts/'. repo
endif endif
let uri = 'https://git:@github.com/' . repo . '.git' let uri = 'https://git::@github.com/' . repo . '.git'
endif endif
let dir = s:dirpath( fnamemodify(join([g:plug_home, a:name], '/'), ':p') ) let dir = s:dirpath( fnamemodify(join([g:plug_home, a:name], '/'), ':p') )
return { 'dir': dir, 'uri': uri } return { 'dir': dir, 'uri': uri }
@ -870,7 +870,7 @@ function! s:update_parallel(pull, todo, threads)
else else
[false, [data.chomp, "PlugClean required."].join($/)] [false, [data.chomp, "PlugClean required."].join($/)]
end end
elsif current_uri.sub(/git:@/, '') != uri.sub(/git:@/, '') elsif current_uri.sub(/git::?@/, '') != uri.sub(/git::?@/, '')
[false, ["Invalid URI: #{current_uri}", [false, ["Invalid URI: #{current_uri}",
"Expected: #{uri}", "Expected: #{uri}",
"PlugClean required."].join($/)] "PlugClean required."].join($/)]
@ -913,8 +913,8 @@ function! s:progress_bar(line, bar, total)
endfunction endfunction
function! s:compare_git_uri(a, b) function! s:compare_git_uri(a, b)
let a = substitute(a:a, 'git:@', '', '') let a = substitute(a:a, 'git:\{1,2}@', '', '')
let b = substitute(a:b, 'git:@', '', '') let b = substitute(a:b, 'git:\{1,2}@', '', '')
return a ==# b return a ==# b
endfunction endfunction

View File

@ -75,7 +75,7 @@ Execute (Subsequent plug#begin() calls will reuse g:plug_home):
Execute (Test Plug command): Execute (Test Plug command):
" Git repo with branch " Git repo with branch
Plug 'junegunn/seoul256.vim', 'yes-t_co' Plug 'junegunn/seoul256.vim', 'yes-t_co'
AssertEqual 'https://git:@github.com/junegunn/seoul256.vim.git', g:plugs['seoul256.vim'].uri AssertEqual 'https://git::@github.com/junegunn/seoul256.vim.git', g:plugs['seoul256.vim'].uri
AssertEqual join([temp_plugged, 'seoul256.vim/'], '/'), g:plugs['seoul256.vim'].dir AssertEqual join([temp_plugged, 'seoul256.vim/'], '/'), g:plugs['seoul256.vim'].dir
AssertEqual 'yes-t_co', g:plugs['seoul256.vim'].branch AssertEqual 'yes-t_co', g:plugs['seoul256.vim'].branch
@ -84,7 +84,7 @@ Execute (Test Plug command):
" Git repo with tag " Git repo with tag
Plug 'junegunn/goyo.vim', '1.5.2' Plug 'junegunn/goyo.vim', '1.5.2'
AssertEqual 'https://git:@github.com/junegunn/goyo.vim.git', g:plugs['goyo.vim'].uri AssertEqual 'https://git::@github.com/junegunn/goyo.vim.git', g:plugs['goyo.vim'].uri
AssertEqual join([temp_plugged, 'goyo.vim/'], '/'), g:plugs['goyo.vim'].dir AssertEqual join([temp_plugged, 'goyo.vim/'], '/'), g:plugs['goyo.vim'].dir
AssertEqual '1.5.2', g:plugs['goyo.vim'].branch AssertEqual '1.5.2', g:plugs['goyo.vim'].branch
@ -99,7 +99,7 @@ Execute (Test Plug command):
" vim-scripts/ " vim-scripts/
Plug 'beauty256' Plug 'beauty256'
AssertEqual 'https://git:@github.com/vim-scripts/beauty256.git', g:plugs.beauty256.uri AssertEqual 'https://git::@github.com/vim-scripts/beauty256.git', g:plugs.beauty256.uri
AssertEqual 'master', g:plugs.beauty256.branch AssertEqual 'master', g:plugs.beauty256.branch
AssertEqual 4, len(g:plugs) AssertEqual 4, len(g:plugs)
@ -199,8 +199,8 @@ Execute (PlugStatus):
call PlugStatusSorted() call PlugStatusSorted()
Expect: Expect:
Expected: https://git:@github.com/junegunn.choi/seoul256.vim.git Expected: https://git::@github.com/junegunn.choi/seoul256.vim.git
Invalid URI: https://git:@github.com/junegunn/seoul256.vim.git Invalid URI: https://git::@github.com/junegunn/seoul256.vim.git
PlugClean required. PlugClean required.
- vim-emoji: OK - vim-emoji: OK
Finished. 1 error(s). Finished. 1 error(s).
@ -233,7 +233,7 @@ Execute (PlugStatus):
call PlugStatusSorted() call PlugStatusSorted()
Expect: Expect:
Expected: https://git:@github.com/junegunn/vim-emoji.git Expected: https://git::@github.com/junegunn/vim-emoji.git
Invalid URI: https://bitbucket.org/junegunn/vim-emoji.git Invalid URI: https://bitbucket.org/junegunn/vim-emoji.git
Not found. Try PlugInstall. Not found. Try PlugInstall.
PlugClean required. PlugClean required.