summaryrefslogtreecommitdiff
path: root/app/controllers/import/github_controller.rb
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-10-19 10:32:15 -0700
committerStan Hu <stanhu@gmail.com>2015-10-19 10:39:59 -0700
commit4ad64ab3f4705b7fa88f855d67e0d2d268c5e395 (patch)
tree1f20b99cd90089bfd3384e045cb8349786651d54 /app/controllers/import/github_controller.rb
parent87d710f5a5661f31876fb5423b6cc588230ff8dc (diff)
downloadgitlab-ce-4ad64ab3f4705b7fa88f855d67e0d2d268c5e395.tar.gz
Fix duplicate repositories in GitHub import page
By default, all the current user's repositories are accessible via the /users endpoint. There's no need to traverse all the organization repositories as well. See: * http://www.rubydoc.info/github/pengwynn/octokit/Octokit/Client/Repositories#repositories-instance_method * https://developer.github.com/v3/repos/#list-your-repositories Closes #2523
Diffstat (limited to 'app/controllers/import/github_controller.rb')
-rw-r--r--app/controllers/import/github_controller.rb4
1 files changed, 0 insertions, 4 deletions
diff --git a/app/controllers/import/github_controller.rb b/app/controllers/import/github_controller.rb
index aae77d384c6..67bf4190e7e 100644
--- a/app/controllers/import/github_controller.rb
+++ b/app/controllers/import/github_controller.rb
@@ -11,10 +11,6 @@ class Import::GithubController < Import::BaseController
def status
@repos = client.repos
- client.orgs.each do |org|
- @repos += client.org_repos(org.login)
- end
-
@already_added_projects = current_user.created_projects.where(import_type: "github")
already_added_projects_names = @already_added_projects.pluck(:import_source)