diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2022-05-09 00:29:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-09 00:29:50 +0200 |
commit | a9ca4b410080814051952f71a8339ea81e0de8bf (patch) | |
tree | 7201cc3caa17b361f5555298e52f31b78f756564 /routers/web | |
parent | 9efa47131f3fa576bd0ef73fa4c5b96c95d89906 (diff) | |
download | gitea-a9ca4b410080814051952f71a8339ea81e0de8bf.tar.gz gitea-a9ca4b410080814051952f71a8339ea81e0de8bf.zip |
Calculate filename hash only once (#19654)
* Calculate hash only once.
* remove unused Sha1 template helper function, use ctx.Data["FileNameHash"]
* fix unit tests
Diffstat (limited to 'routers/web')
-rw-r--r-- | routers/web/repo/compare.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/web/repo/compare.go b/routers/web/repo/compare.go index d483227ebf..31914c43ab 100644 --- a/routers/web/repo/compare.go +++ b/routers/web/repo/compare.go @@ -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) |