Refactor RefName (#33234)

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

No files matched your search

+3 -3
View File
@@ -84,9 +84,9 @@ func SlackLinkFormatter(url, text string) string {
// SlackLinkToRef slack-formatter link to a repo ref
func SlackLinkToRef(repoURL, ref string) string {
// FIXME: SHA1 hardcoded here
url := git.RefURL(repoURL, ref)
refName := git.RefName(ref).ShortName()
return SlackLinkFormatter(url, refName)
refName := git.RefName(ref)
url := repoURL + "/src/" + refName.RefWebLinkPath()
return SlackLinkFormatter(url, refName.ShortName())
}
// Create implements payloadConvertor Create method