Skip to content

Commit

Permalink
Fix invalid issue branch reference if not specified in template (#22513
Browse files Browse the repository at this point in the history
…) (#22520)

Backport #22513

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
  • Loading branch information
jolheiser and brechtvl authored Jan 19, 2023
1 parent 4b3e456 commit fa33271
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion routers/web/repo/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,8 @@ func setTemplateIfExists(ctx *context.Context, ctxDataKey string, possibleFiles
}

}
if !strings.HasPrefix(template.Ref, "refs/") { // Assume that the ref intended is always a branch - for tags users should use refs/tags/<ref>

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>
template.Ref = git.BranchPrefix + template.Ref
}
ctx.Data["HasSelectedLabel"] = len(labelIDs) > 0
Expand Down

0 comments on commit fa33271

Please sign in to comment.