mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
x/tools/dashboard/app: record branch names, disallow multiple first commits
Change-Id: I3fed749bb0b5c2084a490eb4c6696c4555a0ac9c Reviewed-on: https://go-review.googlesource.com/1174 Reviewed-by: David Symonds <dsymonds@golang.org>
This commit is contained in:
parent
78a571aa37
commit
97f1340e43
@ -94,6 +94,7 @@ type Commit struct {
|
||||
Time time.Time
|
||||
NeedsBenchmarking bool
|
||||
TryPatch bool
|
||||
Branch string
|
||||
|
||||
// ResultData is the Data string of each build Result for this Commit.
|
||||
// For non-Go commits, only the Results for the current Go tip, weekly,
|
||||
|
@ -183,6 +183,11 @@ func addCommit(c appengine.Context, com *Commit) error {
|
||||
if n == 0 {
|
||||
return errors.New("parent commit not found")
|
||||
}
|
||||
} else if com.Num != 1 {
|
||||
// This is the first commit; fail if it is not number 1.
|
||||
// (This will happen if we try to upload a new/different repo
|
||||
// where there is already commit data. A bad thing to do.)
|
||||
return errors.New("this package already has a first commit; aborting")
|
||||
}
|
||||
// update the tip Tag if this is the Go repo and this isn't on a release branch
|
||||
if p.Path == "" && !strings.HasPrefix(com.Desc, "[") && !isUpdate {
|
||||
|
Loading…
x
Reference in New Issue
Block a user