Skip to content

Commit a61f5ca

Browse files
committed
Fix invalid issue branch reference if not specified in template
1 parent 7ddc11d commit a61f5ca

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -784,8 +784,10 @@ func setTemplateIfExists(ctx *context.Context, ctxDataKey string, possibleFiles
784784
}
785785

786786
}
787-
if !strings.HasPrefix(template.Ref, "refs/") { // Assume that the ref intended is always a branch - for tags users should use refs/tags/<ref>
788-
template.Ref = git.BranchPrefix + template.Ref
787+
if template.Ref != "" {
788+
if !strings.HasPrefix(template.Ref, "refs/") { // Assume that the ref intended is always a branch - for tags users should use refs/tags/<ref>
789+
template.Ref = git.BranchPrefix + template.Ref
790+
}
789791
}
790792
ctx.Data["HasSelectedLabel"] = len(labelIDs) > 0
791793
ctx.Data["label_ids"] = strings.Join(labelIDs, ",")

0 commit comments

Comments
 (0)