Skip to content

Commit

Permalink
fix(config): manage case with branch with multiple / in their names
Browse files Browse the repository at this point in the history
Related to ejoffe#415
  • Loading branch information
davinkevin committed Jul 22, 2024
1 parent 3b7152c commit a13d2c8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions config/config_parser/remote_branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func NewRemoteBranchSource(gitcmd git.GitInterface) *remoteBranch {
}
}

var _remoteBranchRegex = regexp.MustCompile(`^## ([a-zA-Z0-9_\-/\.]+)\.\.\.([a-zA-Z0-9_\-/\.]+)/([a-zA-Z0-9_\-/\.]+)`)
var _remoteBranchRegex = regexp.MustCompile(`^## ([a-zA-Z0-9_\-/\.]+)\.\.\.([a-zA-Z0-9_\-\.]+)/([a-zA-Z0-9_\-/\.]+)`)

func (s *remoteBranch) Load(cfg interface{}) {
var output string
Expand All @@ -32,5 +32,7 @@ func (s *remoteBranch) Load(cfg interface{}) {
repoCfg := cfg.(*config.RepoConfig)

repoCfg.GitHubRemote = matches[2]
repoCfg.GitHubBranch = matches[3]
if repoCfg.GitHubBranch == "" {
repoCfg.GitHubBranch = matches[3]
}
}

0 comments on commit a13d2c8

Please sign in to comment.