diff --git a/dashboard/app/build/build.go b/dashboard/app/build/build.go index 90ca344bd8..9e965edba0 100644 --- a/dashboard/app/build/build.go +++ b/dashboard/app/build/build.go @@ -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, diff --git a/dashboard/app/build/handler.go b/dashboard/app/build/handler.go index ee75ba9b77..931ffc12f1 100644 --- a/dashboard/app/build/handler.go +++ b/dashboard/app/build/handler.go @@ -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 {