1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Refactor RefName (#33234)

And fix some FIXMEs
This commit is contained in:
wxiaoguang
2025-01-13 14:01:53 +08:00
committed by GitHub
parent 81352542fd
commit 2ea929a952
13 changed files with 58 additions and 60 deletions

View File

@@ -250,8 +250,9 @@ func GetRefEndNamesAndURLs(issues []*issues_model.Issue, repoLink string) (map[i
issueRefURLs := make(map[int64]string, len(issues))
for _, issue := range issues {
if issue.Ref != "" {
issueRefEndNames[issue.ID] = git.RefName(issue.Ref).ShortName()
issueRefURLs[issue.ID] = git.RefURL(repoLink, issue.Ref)
ref := git.RefName(issue.Ref)
issueRefEndNames[issue.ID] = ref.ShortName()
issueRefURLs[issue.ID] = repoLink + "/src/" + ref.RefWebLinkPath()
}
}
return issueRefEndNames, issueRefURLs