From cd1fbccc74ee4ce4ad036d265d3841d0dca520ac Mon Sep 17 00:00:00 2001 From: Mustafa Gezen Date: Tue, 1 Jun 2021 17:40:24 +0200 Subject: [PATCH] Add failsafe to branch detection --- internal/patch.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/patch.go b/internal/patch.go index e2174b2..3c9a4ba 100644 --- a/internal/patch.go +++ b/internal/patch.go @@ -294,7 +294,7 @@ func patchModuleYaml(pd *data.ProcessData, md *data.ModeData) { // versions are not that important if strings.HasPrefix(rpm.Ref, "stream-rhel-rhel-") { pushBranch = defaultBranch - } else if strings.HasPrefix(rpm.Ref, "stream-rhel-") { + } else if strings.HasPrefix(rpm.Ref, "stream-rhel-") && len(split) > 4 { repString := fmt.Sprintf("%s%ss-", pd.BranchPrefix, string(split[4][0])) newString := fmt.Sprintf("%s%s-", pd.BranchPrefix, string(split[4][0])) pushBranch = strings.Replace(md.PushBranch, repString, newString, 1)