Skip to content

Commit 76d3e8d

Browse files
committed
Do not inject git:: to url when git 2.3.0 or above found
Related: #161
1 parent 54fc8a4 commit 76d3e8d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

plug.vim

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ endfunction
109109

110110
function! s:define_commands()
111111
command! -nargs=+ -bar Plug call s:add(<args>)
112+
let s:default_url_format =
113+
\ !s:is_win && executable('git') && s:git_version_requirement(2, 3) ?
114+
\ 'https://github.com/%s.git' : 'https://git::@github.com/%s.git'
112115
if !executable('git')
113116
return s:err('`git` executable not found. vim-plug requires git.')
114117
endif
@@ -460,7 +463,7 @@ function! s:infer_properties(name, repo)
460463
if repo !~ '/'
461464
let repo = 'vim-scripts/'. repo
462465
endif
463-
let fmt = get(g:, 'plug_url_format', 'https://git::@github.com/%s.git')
466+
let fmt = get(g:, 'plug_url_format', s:default_url_format)
464467
let uri = printf(fmt, repo)
465468
endif
466469
let dir = s:dirpath( fnamemodify(join([g:plug_home, a:name], '/'), ':p') )
@@ -744,6 +747,10 @@ function! s:update_impl(pull, force, args) abort
744747
call append(0, ['', ''])
745748
normal! 2G
746749

750+
if !s:is_win
751+
let $GIT_TERMINAL_PROMPT = 0
752+
endif
753+
747754
if s:ruby && s:update.threads > 1
748755
try
749756
let imd = &imd

0 commit comments

Comments
 (0)