aboutsummaryrefslogtreecommitdiffstats
path: root/modules/git/batch_reader.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-04-22 00:31:59 +0800
committerGitHub <noreply@github.com>2021-04-21 18:31:59 +0200
commit2255afffad4ff8173c73b7cec8dbd66d986eaf5c (patch)
tree92cd1967c9f264f1dd3016c512aea11fb37dfd39 /modules/git/batch_reader.go
parent9b8ffa1c7a886e3b550c64799463a5d4f965a2f7 (diff)
downloadgitea-2255afffad4ff8173c73b7cec8dbd66d986eaf5c.tar.gz
gitea-2255afffad4ff8173c73b7cec8dbd66d986eaf5c.zip
Fix lfs management find (#15537)
Fix #15236 * Do not do 40byte conversion within ParseTreeLine * Missed a to40ByteSHA Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'modules/git/batch_reader.go')
-rw-r--r--modules/git/batch_reader.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/git/batch_reader.go b/modules/git/batch_reader.go
index 6014508b93..1905067cb4 100644
--- a/modules/git/batch_reader.go
+++ b/modules/git/batch_reader.go
@@ -149,10 +149,10 @@ headerLoop:
// constant hextable to help quickly convert between 20byte and 40byte hashes
const hextable = "0123456789abcdef"
-// to40ByteSHA converts a 20-byte SHA in a 40-byte slice into a 40-byte sha in place
+// To40ByteSHA converts a 20-byte SHA in a 40-byte slice into a 40-byte sha in place
// without allocations. This is at least 100x quicker that hex.EncodeToString
// NB This requires that sha is a 40-byte slice
-func to40ByteSHA(sha []byte) []byte {
+func To40ByteSHA(sha []byte) []byte {
for i := 19; i >= 0; i-- {
v := sha[i]
vhi, vlo := v>>4, v&0x0f