Skip to content

Commit

Permalink
Only load git tag names
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew committed Mar 25, 2016
1 parent cac223b commit 1c48354
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/github_repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,13 @@ def download_github_contributions(token = nil)
end

def download_tags(token = nil)
existing_tags = github_tags.to_a
existing_tag_names = github_tags.pluck(:name)
github_client(token).refs(full_name, 'tags').each do |tag|
return unless tag['ref']
match = tag.ref.match(/refs\/tags\/(.*)/)
if match
name = match[1]
if existing_tags.find{|t| t.name == name }.nil?
unless existing_tag_names.include?(name)

object = github_client(token).get(tag.object.url)

Expand Down

0 comments on commit 1c48354

Please sign in to comment.