chore: fix legacy git ref problems (#38827)

1. add correct "refs/heads" prefix to the branch name for commit graph
2. fix incorrect cache key in GetCommitGraphsCount
3. remove the "--" trim for the tag name, there is no security vulnerability, we never do so anywhere else

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
wxiaoguang
2026-08-08 07:04:36 +08:00
committed by GitHub
parent 09f78aed19
commit f899dfd6e0
5 changed files with 31 additions and 27 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ import (
// EncodeSha256 string to sha256 hex value.
func EncodeSha256(str string) string {
h := sha256.New()
_, _ = h.Write([]byte(str))
_, _ = h.Write(util.UnsafeStringToBytes(str))
return hex.EncodeToString(h.Sum(nil))
}