Branch names are hard

This commit is contained in:
Jakob Borg 2016-03-10 10:47:15 +01:00
parent 28d74f5d9b
commit 64cfebc63c
1 changed files with 7 additions and 1 deletions

View File

@ -537,12 +537,18 @@ func getBranchSuffix() string {
return ""
}
branch = string(parts[len(parts)-1])
branch = parts[len(parts)-1]
if branch == "master" {
// master builds are the default.
return ""
}
validBranchRe := regexp.MustCompile(`^[a-zA-Z0-9_.-]$`)
if !validBranchRe.MatchString(branch) {
// There's some odd stuff in the branch name. Better skip it.
return ""
}
return "-" + branch
}