Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Avoid a name conflict with L9
Plugin 'user/L9', {'name': 'newL9'}
" Install a specific branch/tag/revision
Plugin 'WoLpH/nerdtree@patch-1'

" All of your Plugins must be added before the following line
call vundle#end() " required
Expand Down
9 changes: 8 additions & 1 deletion autoload/vundle/config.vim
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,13 @@ func! s:parse_name(arg)
let arg = a:arg
let git_proto = exists('g:vundle_default_git_proto') ? g:vundle_default_git_proto : 'https'

if arg =~? '@'
let revision = split(arg, '@')[-1]
let arg = split(arg, '@')[0]
else
let revision = 'master'
endif

if arg =~? '^\s*\(gh\|github\):\S\+'
\ || arg =~? '^[a-z0-9][a-z0-9-]*/[^/]\+$'
let uri = git_proto.'://github.com/'.split(arg, ':')[-1]
Expand All @@ -155,7 +162,7 @@ func! s:parse_name(arg)
let name = arg
let uri = git_proto.'://github.com/vim-scripts/'.name.'.git'
endif
return {'name': name, 'uri': uri, 'name_spec': arg }
return {'name': name, 'uri': uri, 'name_spec': arg, 'revision': revision }
endf


Expand Down
12 changes: 9 additions & 3 deletions autoload/vundle/installer.vim
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ func! s:make_sync_command(bang, bundle) abort
\ 'git fetch',
\ 'git reset --hard origin/HEAD',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'git reset --hard origin/'.a:bundle.revision,
I think this is what you want (which was done in line 396 in a wrong way) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would probably work too. In what way is line 396 wrong? I've been using this fork for a while without any issues

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's usual that the wrong codes "works", but this doesn't means it's right.

What if the a:bundle.revision branch uses a new submodule ?

\ 'git submodule update --init --recursive',
\ 'git checkout '.a:bundle.revision,
\ ]
let cmd = join(cmd_parts, ' && ')
let cmd = vundle#installer#shellesc_cd(cmd)
Expand All @@ -410,14 +411,19 @@ func! s:make_sync_command(bang, bundle) abort
\ 'git pull',
\ 'git submodule update --init --recursive',
\ ]
let cmd = join(cmd_parts, ' && ')
let cmd = vundle#installer#shellesc_cd(cmd)

let initial_sha = s:get_current_sha(a:bundle)
else
let cmd = 'git clone --recursive '.vundle#installer#shellesc(a:bundle.uri).' '.vundle#installer#shellesc(a:bundle.path())
let cmd_parts = [
\ 'git clone --recursive '.vundle#installer#shellesc(a:bundle.uri).' '.vundle#installer#shellesc(a:bundle.path()),
\ 'cd '.vundle#installer#shellesc(a:bundle.path()),
\ ]
let initial_sha = ''
endif

let cmd_parts = cmd_parts + ['git checkout '.a:bundle.revision]
let cmd = join(cmd_parts, ' && ')
let cmd = vundle#installer#shellesc_cd(cmd)
return [cmd, initial_sha]
endf

Expand Down