cmd/coordinator: delete duplicate struct field
tryKey had both a Project and Repo string field, and both had the same
value from Gerrit. Delete Repo and use Project (the Gerrit term) instead.
Change-Id: Ie1a68376a980dfc2b839544bc56faa63655ddb58
Reviewed-on: https://go-review.googlesource.com/51530
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/cmd/coordinator/coordinator.go b/cmd/coordinator/coordinator.go
index 44d75cf..f8ec446 100644
--- a/cmd/coordinator/coordinator.go
+++ b/cmd/coordinator/coordinator.go
@@ -865,7 +865,6 @@
Branch: ci.Branch,
ChangeID: ci.ChangeID,
Commit: ci.CurrentRevision,
- Repo: ci.Project,
}
tryList = append(tryList, key)
wanted[key] = true
@@ -897,7 +896,6 @@
Branch string // master
ChangeID string // I1a27695838409259d1586a0adfa9f92bccf7ceba
Commit string // ecf3dffc81dc21408fb02159af352651882a8383
- Repo string // "go"
}
// ChangeTriple returns the Gerrit (project, branch, change-ID) triple
@@ -951,7 +949,7 @@
// Must hold statusMu.
func newTrySet(key tryKey, ci *gerrit.ChangeInfo) (*trySet, error) {
goHead := getRepoHead("go")
- if key.Repo != "go" && goHead == "" {
+ if key.Project != "go" && goHead == "" {
// We don't know the go HEAD yet (but we will)
// so don't create this trySet yet as we don't
// know which Go revision to build against.
@@ -959,7 +957,7 @@
}
builders := tryBuilders
- if key.Repo != "go" {
+ if key.Project != "go" {
builders = subTryBuilders
}
@@ -992,7 +990,7 @@
}
func tryKeyToBuilderRev(builder string, key tryKey) buildgo.BuilderRev {
- if key.Repo == "go" {
+ if key.Project == "go" {
return buildgo.BuilderRev{
Name: builder,
Rev: key.Commit,
@@ -1001,7 +999,7 @@
return buildgo.BuilderRev{
Name: builder,
Rev: getRepoHead("go"),
- SubName: key.Repo,
+ SubName: key.Project,
SubRev: key.Commit,
}
}
@@ -3293,6 +3291,7 @@
// repoHead contains the hashes of the latest master HEAD
// for each sub-repo. It is populated by findWork.
+// TODO: replace with a maintner gRPC call.
var repoHead = struct {
sync.Mutex
m map[string]string // [repo]hash (["go"]"d3adb33f")