Fix bug causing private organization repositories to not be collected

This commit is contained in:
Michael Henriksen
2016-03-19 14:26:52 +01:00
parent f72a2c57b7
commit 01ec2b6802
2 changed files with 10 additions and 3 deletions
+9 -3
View File
@@ -82,9 +82,15 @@ module Gitrob
end
def get_repositories(owner)
github_client do |client|
client.repos.list(
:user => owner["login"]).reject { |r| r["fork"] }
if owner["type"] == "Organization"
github_client do |client|
client.repos.list(:org => owner["login"], :type => "sources")
end
else
github_client do |client|
client.repos.list(
:user => owner["login"]).reject { |r| r["fork"] }
end
end
end