Browse Source

Use git pull --depth only on new repo

Using pull with depth option on a non-empty repo may cause some trouble.
pull/252/head
Xidorn Quan 13 years ago
parent
commit
73fb175e01
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      autoload/vundle/installer.vim

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

@ -214,6 +214,7 @@ func! s:sync(bang, bundle, rtp) abort
let get_current_sha = g:shellesc_cd('cd '.bundle_path) let get_current_sha = g:shellesc_cd('cd '.bundle_path)
let get_current_sha .= ' && git rev-parse HEAD' let get_current_sha .= ' && git rev-parse HEAD'
let initial_sha = system(get_current_sha)[0:15] let initial_sha = system(get_current_sha)[0:15]
let cmd .= ' && git pull origin master'
else else
call mkdir(a:bundle.path(), 'p') call mkdir(a:bundle.path(), 'p')
let cmd .= ' && git init' let cmd .= ' && git init'
@ -225,9 +226,9 @@ func! s:sync(bang, bundle, rtp) abort
let cmd .= ' && echo '.shellescape(a:rtp).' >> .git/info/sparse-checkout' let cmd .= ' && echo '.shellescape(a:rtp).' >> .git/info/sparse-checkout'
endif endif
let initial_sha = '' let initial_sha = ''
let cmd .= ' && git pull --depth=1 origin master'
endif endif
let cmd .= ' && git pull --depth=1 origin master'
if empty(a:rtp) if empty(a:rtp)
" TODO: It causes error when using rtp because no .gitmodule " TODO: It causes error when using rtp because no .gitmodule
" is checked out " is checked out


Loading…
Cancel
Save