mirror of
https://github.com/rocky-linux/srpmproc.git
synced 2025-01-09 09:50:55 +00:00
14 lines
432 B
Go
14 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))
|
|
}
|
|
}
|