Method: Ra10ke::GitRepo#all_refs
- Defined in:
- lib/ra10ke/git_repo.rb
#all_refs ⇒ Array
Returns - an array of all the refs associated with the remote repository.
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/ra10ke/git_repo.rb', line 84 def all_refs @all_refs ||= remote_refs.each_with_object([]) do |line, refs| sha, ref = line.split("\t") next refs if line.include?('redirecting') next refs if sha.eql?('ref: refs/heads/master') _, type, name, subtype = ref.chomp.split('/') next refs unless name type = :tag if type.eql?('tags') type = type.to_sym subtype = subtype.to_sym if subtype type = :branch if type.eql?(:heads) refs << { sha: sha, ref: ref.chomp, type: type, subtype: subtype, name: name } end end |