1
0
mirror of https://github.com/golang/go synced 2024-09-30 22:58:34 -06:00

go.tools/dashboard/app: show main repo commits with no build results

The UI template iterates over ResultGoHashes to display the Commit
rows. This was done for the sub-repository build view, where it
only makes sense to show a row when there's build data for it.

However, in the main page UI we do want to see if a commit has hit
the dashboard but has not yet been built.

This change causes the dashboard to show the commit row even if
there are no build results for it yet.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/153010043
This commit is contained in:
Andrew Gerrand 2014-10-04 14:18:41 +10:00
parent 4fb5eee0bd
commit 51be54e32f

View File

@ -215,6 +215,12 @@ func (c *Commit) Results() (results []*Result) {
}
func (c *Commit) ResultGoHashes() []string {
// For the main repo, just return the empty string
// (there's no corresponding main repo hash for a main repo Commit).
// This function is only really useful for sub-repos.
if c.PackagePath == "" {
return []string{""}
}
var hashes []string
for _, r := range c.ResultData {
p := strings.SplitN(r, "|", 4)