@@ -17,7 +17,7 @@ import (
17
17
18
18
var (
19
19
ErrNotReleaseBranch = errors .New ("this is not a release branch" )
20
- releaseBranchRegexp = regexp .MustCompile (`.*(\d+\.\d+)$` )
20
+ releaseBranchRegexp = regexp .MustCompile (`.*(\d+\.( \d+|x) )$` )
21
21
)
22
22
23
23
type outputReader func (io.Reader ) error
@@ -26,7 +26,7 @@ type outputReader func(io.Reader) error
26
26
// current repository ordered descending by creation date.
27
27
// e.g. 8.13, 8.12, etc.
28
28
func GetReleaseBranches (ctx context.Context ) ([]string , error ) {
29
- c := exec .CommandContext (ctx , "git" , "branch" , "-r" , "--list" , "*/[0-9]*.*[0-9 ]" , "--sort=-creatordate" )
29
+ c := exec .CommandContext (ctx , "git" , "branch" , "-r" , "--list" , "*/[0-9]*.*[0-9x ]" , "--sort=-creatordate" )
30
30
31
31
branchList := []string {}
32
32
err := runCommand (c , releaseBranchReader (& branchList ))
@@ -99,8 +99,8 @@ func extractReleaseBranch(branch string) (string, error) {
99
99
}
100
100
101
101
matches := releaseBranchRegexp .FindStringSubmatch (branch )
102
- if len (matches ) != 2 {
103
- return "" , fmt .Errorf ("failed to process branch %q: expected 2 matches, got %d" , branch , len (matches ))
102
+ if len (matches ) != 3 {
103
+ return "" , fmt .Errorf ("failed to process branch %q: expected 3 matches, got %d" , branch , len (matches ))
104
104
}
105
105
return matches [1 ], nil
106
106
}
0 commit comments