Commit acc1af5f authored by Douwe Maan's avatar Douwe Maan Committed by Robert Speicher

Merge branch 'remove-duplicate-repos-in-github-import' into 'master'

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

See merge request !1644
parent 44d35a82
Please view this file on the master branch, on stable branches it's out of date. Please view this file on the master branch, on stable branches it's out of date.
v 8.2.0 (unreleased)
- Fix duplicate repositories in GitHub import page (Stan Hu)
- Show last project commit to default branch on project home page
- Highlight comment based on anchor in URL
- Adds ability to remove the forked relationship from project settings screen. (Han Loong Liauw)
- Improved performance of sorting milestone issues
- Allow users to select the Files view as default project view (Cristian Bica)
v 8.1.0 (unreleased) v 8.1.0 (unreleased)
- Send an email to admin email when a user is reported for spam (Jonathan Rochkind) - Send an email to admin email when a user is reported for spam (Jonathan Rochkind)
- Show notifications button when user is member of group rather than project (Grzegorz Bizon) - Show notifications button when user is member of group rather than project (Grzegorz Bizon)
......
...@@ -11,10 +11,6 @@ class Import::GithubController < Import::BaseController ...@@ -11,10 +11,6 @@ class Import::GithubController < Import::BaseController
def status def status
@repos = client.repos @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 = current_user.created_projects.where(import_type: "github")
already_added_projects_names = @already_added_projects.pluck(:import_source) already_added_projects_names = @already_added_projects.pluck(:import_source)
......
...@@ -41,7 +41,7 @@ describe Import::GithubController do ...@@ -41,7 +41,7 @@ describe Import::GithubController do
it "assigns variables" do it "assigns variables" do
@project = create(:project, import_type: 'github', creator_id: user.id) @project = create(:project, import_type: 'github', creator_id: user.id)
stub_client(repos: [@repo], orgs: [@org], org_repos: [@org_repo]) stub_client(repos: [@repo, @org_repo], orgs: [@org], org_repos: [@org_repo])
get :status get :status
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment