cmd/coordinator: plumb down branch name for perf builder

Downstream consumers of performance data would have a much easier time
if they knew the intended branch that the commit being tested was
originally landed on. Pass another environment variable indicating the
branch name.

Change-Id: Id40b0b3f8ba8e8a5a031cef72196080e2479ffa4
Reviewed-on: https://go-review.googlesource.com/c/build/+/385694
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alex Rakoczy <alex@golang.org>
diff --git a/cmd/coordinator/buildstatus.go b/cmd/coordinator/buildstatus.go
index ab94a21..42b32ea 100644
--- a/cmd/coordinator/buildstatus.go
+++ b/cmd/coordinator/buildstatus.go
@@ -1325,8 +1325,13 @@
 	sp = st.CreateSpan("running_subrepo_tests", st.SubName)
 	defer func() { sp.Done(err) }()
 
+	branch := st.goBranch
+	if branch == "" {
+		branch = "master"
+	}
 	env := append(st.conf.Env(),
 		"BENCH_BASELINE_GOROOT="+baselineGoroot,
+		"BENCH_BRANCH="+branch,
 		"GOROOT="+goroot,
 		"GOPATH="+gopath,
 		"GOPROXY="+moduleProxy(), // GKE value but will be ignored/overwritten by reverse buildlets