From e48043c53cc8c934fb3a3afc4ca000dab905b8fc Mon Sep 17 00:00:00 2001 From: Will Norris Date: Mon, 6 Jul 2015 08:29:10 -0700 Subject: [PATCH] remove org permission preview media type These changes are now official, so the custom media type is no longer needed. This does go ahead and remove RepositoryListOptions.IncludeOrg which was being used to trigger the custom media type. Even though this is a breaking change, it was only in for a month and I don't think it was too widely used during that time. Fixes #219 /cc @captncraig who may have been using this Change-Id: Ib54ced78c51a9c4e54e470136d36f91bf4716e8c --- github/github.go | 3 --- github/repos.go | 9 --------- github/repos_test.go | 3 +-- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/github/github.go b/github/github.go index 3aa643c..558e673 100644 --- a/github/github.go +++ b/github/github.go @@ -42,9 +42,6 @@ const ( // https://developer.github.com/changes/2014-12-09-new-attributes-for-stars-api/ mediaTypeStarringPreview = "application/vnd.github.v3.star+json" - - // https://developer.github.com/changes/2014-12-08-organization-permissions-api-preview/ - mediaTypeOrganizationsPreview = "application/vnd.github.moondragon+json" ) // A Client manages communication with the GitHub API. diff --git a/github/repos.go b/github/repos.go index 86d9ad0..ed9052c 100644 --- a/github/repos.go +++ b/github/repos.go @@ -122,11 +122,6 @@ type RepositoryListOptions struct { // Default is "asc" when sort is "full_name", otherwise default is "desc". Direction string `url:"direction,omitempty"` - // Include orginization repositories the user has access to. - // This will become the default behavior in the future, but is opt-in for now. - // See https://developer.github.com/changes/2015-01-07-prepare-for-organization-permissions-changes/ - IncludeOrg bool `url:"-"` - ListOptions } @@ -151,10 +146,6 @@ func (s *RepositoriesService) List(user string, opt *RepositoryListOptions) ([]R return nil, nil, err } - if opt != nil && opt.IncludeOrg { - req.Header.Set("Accept", mediaTypeOrganizationsPreview) - } - repos := new([]Repository) resp, err := s.client.Do(req, repos) if err != nil { diff --git a/github/repos_test.go b/github/repos_test.go index 2480b88..3a2c413 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -45,11 +45,10 @@ func TestRepositoriesService_List_specifiedUser(t *testing.T) { "direction": "asc", "page": "2", }) - testHeader(t, r, "Accept", mediaTypeOrganizationsPreview) fmt.Fprint(w, `[{"id":1}]`) }) - opt := &RepositoryListOptions{"owner", "created", "asc", true, ListOptions{Page: 2}} + opt := &RepositoryListOptions{"owner", "created", "asc", ListOptions{Page: 2}} repos, _, err := client.Repositories.List("u", opt) if err != nil { t.Errorf("Repositories.List returned error: %v", err)