Skip to content

Commit f24b665

Browse files
author
Bertrand Roussel
committed
Prevent error if no entry in ls_remote
Otherwise it would fail with: /home/broussel/.rvm/gems/ruby-2.2.1/bundler/gems/ruby-git-7df9d79d5b63/lib/git/lib.rb:417:in `block (2 levels) in ls_remote': undefined method `split' for nil:NilClass (NoMethodError) from /home/broussel/.rvm/gems/ruby-2.2.1/bundler/gems/ruby-git-7df9d79d5b63/lib/git/lib.rb:415:in `each' from /home/broussel/.rvm/gems/ruby-2.2.1/bundler/gems/ruby-git-7df9d79d5b63/lib/git/lib.rb:415:in `block in ls_remote' from /home/broussel/.rvm/gems/ruby-2.2.1/bundler/gems/ruby-git-7df9d79d5b63/lib/git/lib.rb:414:in `tap' from /home/broussel/.rvm/gems/ruby-2.2.1/bundler/gems/ruby-git-7df9d79d5b63/lib/git/lib.rb:414:in `ls_remote' from /home/broussel/.rvm/gems/ruby-2.2.1/bundler/gems/ruby-git-7df9d79d5b63/lib/git.rb:149:in `ls_remote'
1 parent 60f429a commit f24b665

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/git/lib.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ def ls_remote(location=nil)
414414
Hash.new{ |h,k| h[k] = {} }.tap do |hsh|
415415
command_lines('ls-remote', [location], false).each do |line|
416416
(sha, info) = line.split("\t")
417+
next if not info
417418
(ref, type, name) = info.split('/', 3)
418419
type ||= 'head'
419420
type = 'branches' if type == 'heads'

0 commit comments

Comments
 (0)