Skip to content

Commit b71a2a0

Browse files
committed
Fix invalid issue branch reference if not specified in template
1 parent aa87b36 commit b71a2a0

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
@@ -784,7 +784,8 @@ 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>
787+
788+
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>
788789
template.Ref = git.BranchPrefix + template.Ref
789790
}
790791
ctx.Data["HasSelectedLabel"] = len(labelIDs) > 0

0 commit comments

Comments
 (0)