dashboard: quote metacharacters when searching for gcc commits
LGTM=adg R=adg CC=golang-codereviews, iant https://golang.org/cl/131420043
This commit is contained in:
parent
5dca7d8bd1
commit
86df324d65
|
|
@ -10,6 +10,7 @@ import (
|
|||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
|
|
@ -184,12 +185,13 @@ func (env *gccgoEnv) setup(repo *Repo, workpath, hash string, envv []string) (st
|
|||
}
|
||||
var errMsg string
|
||||
if isMirrored {
|
||||
commitDesc, err := repo.Master.VCS.LogAtRev(repo.Path, hash, "{desc|escape}")
|
||||
commitDesc, err := repo.Master.VCS.LogAtRev(repo.Path, hash, "{desc|firstline|escape}")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
logCmd = append(logCmd, "--grep", "'"+string(commitDesc)+"'", "--regexp-ignore-case")
|
||||
quotedDesc := regexp.QuoteMeta(string(commitDesc))
|
||||
logCmd = append(logCmd, "--grep", quotedDesc, "--regexp-ignore-case", "--extended-regexp")
|
||||
errMsg = fmt.Sprintf("Failed to find a commit with a similar description to '%s'", string(commitDesc))
|
||||
} else {
|
||||
commitDate, err := repo.Master.VCS.LogAtRev(repo.Path, hash, "{date|rfc3339date}")
|
||||
|
|
|
|||
Loading…
Reference in New Issue