mirror of
https://github.com/octoleo/syncthing.git
synced 2025-02-02 03:48:26 +00:00
Branch names are hard
This commit is contained in:
parent
28d74f5d9b
commit
64cfebc63c
8
build.go
8
build.go
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user