1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-22 06:39:43 +02:00

github for single repos only, with selectable sub-sections

This commit is contained in:
Elliott Stoneham 2016-09-28 14:42:55 +01:00
parent 7bf9901c9a
commit 6e362c0eac
10 changed files with 104 additions and 28 deletions

View file

@ -90,6 +90,10 @@ const tagCommitsData = "commitsData"
func getCommits(client *gogithub.Client, config *githubConfig) ([]githubCommit, []githubAuthorStats, error) {
if !config.ShowCommits {
return nil, nil, nil
}
// first make sure we've got all the branches
for _, orb := range config.Lists {
if orb.Included {
@ -253,6 +257,11 @@ func getCommits(client *gogithub.Client, config *githubConfig) ([]githubCommit,
}
func refreshCommits(gr *githubRender, config *githubConfig, client *gogithub.Client) (err error) {
if !config.ShowCommits {
return nil
}
gr.BranchCommits, gr.AuthorStats, err = getCommits(client, config)
if err != nil {
log.Error("github refreshCommits:", err)
@ -262,6 +271,11 @@ func refreshCommits(gr *githubRender, config *githubConfig, client *gogithub.Cli
}
func renderCommits(payload *githubRender, c *githubConfig) error {
if !c.ShowCommits {
return nil
}
payload.CommitCount = 0
for range payload.BranchCommits {
payload.CommitCount++