Skip to content

Commit fa33271

Browse files
jolheiserbrechtvl
andauthored
Fix invalid issue branch reference if not specified in template (#22513) (#22520)
Backport #22513 Co-authored-by: Brecht Van Lommel <[email protected]>
1 parent 4b3e456 commit fa33271

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: routers/web/repo/issue.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,8 @@ func setTemplateIfExists(ctx *context.Context, ctxDataKey string, possibleFiles
786786
}
787787

788788
}
789-
if !strings.HasPrefix(template.Ref, "refs/") { // Assume that the ref intended is always a branch - for tags users should use refs/tags/<ref>
789+
790+
if template.Ref != "" && !strings.HasPrefix(template.Ref, "refs/") { // Assume that the ref intended is always a branch - for tags users should use refs/tags/<ref>
790791
template.Ref = git.BranchPrefix + template.Ref
791792
}
792793
ctx.Data["HasSelectedLabel"] = len(labelIDs) > 0

0 commit comments

Comments
 (0)