mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Calculate filename hash only once (#19654)
* Calculate hash only once. * remove unused Sha1 template helper function, use ctx.Data["FileNameHash"] * fix unit tests
This commit is contained in:
@@ -874,7 +874,7 @@ func ExcerptBlob(ctx *context.Context) {
|
||||
}
|
||||
}
|
||||
ctx.Data["section"] = section
|
||||
ctx.Data["fileName"] = filePath
|
||||
ctx.Data["FileNameHash"] = base.EncodeSha1(filePath)
|
||||
ctx.Data["AfterCommitID"] = commitID
|
||||
ctx.Data["Anchor"] = anchor
|
||||
ctx.HTML(http.StatusOK, tplBlobExcerpt)
|
||||
|
Reference in New Issue
Block a user