From da24f714e02f511c9c84592f1d9a3317a25a0a4d Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Thu, 14 Aug 2014 03:11:27 +0900 Subject: [PATCH] Use `git::` prefix to avoid password prompt on git 1.7 (#56) --- plug.vim | 8 ++++---- test/workflow.vader | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/plug.vim b/plug.vim index 07b501f..cbbd5b3 100644 --- a/plug.vim +++ b/plug.vim @@ -379,7 +379,7 @@ function! s:infer_properties(name, repo) if repo !~ '/' let repo = 'vim-scripts/'. repo endif - let uri = 'https://git:@github.com/' . repo . '.git' + let uri = 'https://git::@github.com/' . repo . '.git' endif let dir = s:dirpath( fnamemodify(join([g:plug_home, a:name], '/'), ':p') ) return { 'dir': dir, 'uri': uri } @@ -870,7 +870,7 @@ function! s:update_parallel(pull, todo, threads) else [false, [data.chomp, "PlugClean required."].join($/)] end - elsif current_uri.sub(/git:@/, '') != uri.sub(/git:@/, '') + elsif current_uri.sub(/git::?@/, '') != uri.sub(/git::?@/, '') [false, ["Invalid URI: #{current_uri}", "Expected: #{uri}", "PlugClean required."].join($/)] @@ -913,8 +913,8 @@ function! s:progress_bar(line, bar, total) endfunction function! s:compare_git_uri(a, b) - let a = substitute(a:a, 'git:@', '', '') - let b = substitute(a:b, 'git:@', '', '') + let a = substitute(a:a, 'git:\{1,2}@', '', '') + let b = substitute(a:b, 'git:\{1,2}@', '', '') return a ==# b endfunction diff --git a/test/workflow.vader b/test/workflow.vader index 9c3ec78..efa30e8 100644 --- a/test/workflow.vader +++ b/test/workflow.vader @@ -75,7 +75,7 @@ Execute (Subsequent plug#begin() calls will reuse g:plug_home): Execute (Test Plug command): " Git repo with branch 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 'yes-t_co', g:plugs['seoul256.vim'].branch @@ -84,7 +84,7 @@ Execute (Test Plug command): " Git repo with tag 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 '1.5.2', g:plugs['goyo.vim'].branch @@ -99,7 +99,7 @@ Execute (Test Plug command): " vim-scripts/ 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 4, len(g:plugs) @@ -199,8 +199,8 @@ Execute (PlugStatus): call PlugStatusSorted() Expect: - Expected: https://git:@github.com/junegunn.choi/seoul256.vim.git - Invalid URI: https://git:@github.com/junegunn/seoul256.vim.git + Expected: https://git::@github.com/junegunn.choi/seoul256.vim.git + Invalid URI: https://git::@github.com/junegunn/seoul256.vim.git PlugClean required. - vim-emoji: OK Finished. 1 error(s). @@ -233,7 +233,7 @@ Execute (PlugStatus): call PlugStatusSorted() 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 Not found. Try PlugInstall. PlugClean required.