Exemple #1
0
// Commit returns a filled out github.Commit which happened at time.Unix(t, 0)
func pathsCommit(path []string) []github.RepositoryCommit {
	c := github.Commit{
		SHA: stringPtr("mysha"),
		Committer: &github.CommitAuthor{
			Date: timePtr(time.Unix(10, 0)),
		},
	}
	rc := github.RepositoryCommit{
		SHA:    stringPtr("mysha"),
		Commit: &c,
	}
	files := []github.CommitFile{}
	for _, p := range path {
		f := github.CommitFile{
			Filename: stringPtr(p),
		}
		files = append(files, f)
	}
	rc.Files = files
	return []github.RepositoryCommit{rc}
}