Skip to content

Commit

Permalink
Handle repo ownership changes
Browse files Browse the repository at this point in the history
Only in the case the change occurred between
creating the repo and GHTorrent processing
the event
  • Loading branch information
gousiosg committed Oct 5, 2016
1 parent 6fc2bc1 commit 0aa099b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/ghtorrent/ghtorrent.rb
Expand Up @@ -567,6 +567,11 @@ def ensure_repo(user, repo, recursive = false)
return
end

if r['owner']['login'] != curuser[:login]
info "Repo changed owner from #{curuser[:login]} to #{r['owner']['login']}"
curuser = ensure_user(r['owner']['login'], false, false)
end

repos.insert(:url => r['url'],
:owner_id => curuser[:id],
:name => r['name'],
Expand Down

0 comments on commit 0aa099b

Please sign in to comment.