mirror of
https://github.com/rocky-linux/srpmproc.git
synced 2024-11-16 18:21:25 +00:00
15 lines
432 B
Go
15 lines
432 B
Go
package misc
|
|
|
|
import (
|
|
"fmt"
|
|
"regexp"
|
|
)
|
|
|
|
func GetTagImportRegex(importBranchPrefix string, allowStreamBranches bool) *regexp.Regexp {
|
|
if allowStreamBranches {
|
|
return regexp.MustCompile(fmt.Sprintf("refs/tags/(imports/(%s(?:.s|.)|%s(?:|s).+)/(.*))", importBranchPrefix, importBranchPrefix))
|
|
} else {
|
|
return regexp.MustCompile(fmt.Sprintf("refs/tags/(imports/(%s.|%s.-.+)/(.*))", importBranchPrefix, importBranchPrefix))
|
|
}
|
|
}
|