aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/context/repo.go3
-rw-r--r--modules/git/utils.go3
2 files changed, 6 insertions, 0 deletions
diff --git a/modules/context/repo.go b/modules/context/repo.go
index c363c36994..1a83c49e95 100644
--- a/modules/context/repo.go
+++ b/modules/context/repo.go
@@ -1089,6 +1089,9 @@ func (ctx *Context) IssueTemplatesErrorsFromDefaultBranch() ([]*api.IssueTemplat
if it, err := template.UnmarshalFromEntry(entry, dirName); err != nil {
invalidFiles[fullName] = err
} else {
+ if !strings.HasPrefix(it.Ref, "refs/") { // Assume that the ref intended is always a branch - for tags users should use refs/tags/<ref>
+ it.Ref = git.BranchPrefix + it.Ref
+ }
issueTemplates = append(issueTemplates, it)
}
}
diff --git a/modules/git/utils.go b/modules/git/utils.go
index d6bf9f4413..a439dabae1 100644
--- a/modules/git/utils.go
+++ b/modules/git/utils.go
@@ -100,6 +100,9 @@ func RefURL(repoURL, ref string) string {
return repoURL + "/src/branch/" + refName
case strings.HasPrefix(ref, TagPrefix):
return repoURL + "/src/tag/" + refName
+ case !IsValidSHAPattern(ref):
+ // assume they mean a branch
+ return repoURL + "/src/branch/" + refName
default:
return repoURL + "/src/commit/" + refName
}