From 873509257d2e340e132386a3442ea11c4ebad4d0 Mon Sep 17 00:00:00 2001 From: Elliott Stoneham Date: Thu, 2 Jun 2016 09:00:07 +0100 Subject: [PATCH] Clarify URL format, up to 100 branches & commits --- documize/section/github/github.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/documize/section/github/github.go b/documize/section/github/github.go index fe4b5572..0b31a44b 100644 --- a/documize/section/github/github.go +++ b/documize/section/github/github.go @@ -38,6 +38,7 @@ func clientSecret() string { return request.ConfigString(configKey, "clientSecret") } func authorizationCallbackURL() string { + // NOTE: URL value must have the path and query "/api/public/validate?section=github" return request.ConfigString(configKey, "authorizationCallbackURL") } @@ -195,7 +196,8 @@ func (t *GithubT) Command(w http.ResponseWriter, r *http.Request) { writeJSON(w, []githubBranch{}) // we have nothing to return return } - branches, _, err := client.Repositories.ListBranches(config.Owner, config.Repo, nil) + branches, _, err := client.Repositories.ListBranches(config.Owner, config.Repo, + &gogithub.ListOptions{PerPage: 100}) if err != nil { //fmt.Println(err) // TODO log error @@ -231,7 +233,7 @@ func (*GithubT) githubClient(config githubConfig) *gogithub.Client { func (*GithubT) getCommits(client *gogithub.Client, config githubConfig) ([]githubBranchCommits, error) { guff, _, err := client.Repositories.ListCommits(config.Owner, config.Repo, - &gogithub.CommitsListOptions{SHA: config.Branch}) + &gogithub.CommitsListOptions{SHA: config.Branch, ListOptions: gogithub.ListOptions{PerPage: 100}}) if err != nil { return nil, err }