Browse Source

Automatically set git push url when cloning repo

pull/220/head
Thiago de Arruda 14 years ago
parent
commit
27d0e061f6
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      autoload/vundle/installer.vim

+ 4
- 1
autoload/vundle/installer.vim View File

@ -218,7 +218,10 @@ func! s:sync(bang, bundle) abort
let get_current_sha = 'cd '.shellescape(a:bundle.path()).' && git rev-parse HEAD'
let initial_sha = s:system(get_current_sha)[0:15]
else
let cmd = 'git clone --recursive '.a:bundle.uri.' '.shellescape(a:bundle.path())
let push_uri = substitute(a:bundle.uri, 'https://', 'git@', '')
let push_uri = substitute(push_uri, 'github.com/', 'github.com:', '')
let cmd = 'git clone --recursive '.a:bundle.uri.' '.shellescape(a:bundle.path()).' && '.
\ 'git --git-dir='.shellescape(a:bundle.path().'/.git').' remote set-url --push origin '.push_uri
let initial_sha = ''
endif


Loading…
Cancel
Save