diff options
Diffstat (limited to 'git-codereview/mail.go')
| -rw-r--r-- | git-codereview/mail.go | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/git-codereview/mail.go b/git-codereview/mail.go index 5d385f9..4bcd85c 100644 --- a/git-codereview/mail.go +++ b/git-codereview/mail.go @@ -6,6 +6,7 @@ package main import ( "fmt" + "os" "regexp" "sort" "strings" @@ -47,6 +48,19 @@ func cmdMail(args []string) { exit(2) } + var trybotVotes []string + switch os.Getenv("GIT_CODEREVIEW_TRYBOT") { + case "luci": + trybotVotes = []string{"Commit-Queue+1"} + case "", "farmer": + trybotVotes = []string{"Run-TryBot"} + case "both": + trybotVotes = []string{"Commit-Queue+1", "Run-TryBot"} + default: + fmt.Fprintf(stderr(), "GIT_CODEREVIEW_TRYBOT must be unset, blank, or one of 'luci', 'farmer', or 'both'\n") + exit(2) + } + b := CurrentBranch() var c *Commit @@ -142,8 +156,10 @@ func cmdMail(args []string) { start = "," } if *trybot { - refSpec += start + "l=Run-TryBot" - start = "," + for _, v := range trybotVotes { + refSpec += start + "l=" + v + start = "," + } } if *wip { refSpec += start + "wip" |
