diff options
author | KN4CK3R <KN4CK3R@users.noreply.github.com> | 2021-05-14 15:12:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-14 14:12:11 +0100 |
commit | df72cf62111114237324857d1393d31312bccca9 (patch) | |
tree | cf9701bc068822d93e61a1ab0f32cbf197d85b9e /modules/git/pipeline | |
parent | 1a5659943eba747b05efe564ac57a942b0424f91 (diff) | |
download | gitea-df72cf62111114237324857d1393d31312bccca9.tar.gz gitea-df72cf62111114237324857d1393d31312bccca9.zip |
Fix LFS commit finder not working (#15856)
* Create a copy of the sha bytes.
Co-authored-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'modules/git/pipeline')
-rw-r--r-- | modules/git/pipeline/lfs_nogogit.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/git/pipeline/lfs_nogogit.go b/modules/git/pipeline/lfs_nogogit.go index 6113bb301d..e618dd04b7 100644 --- a/modules/git/pipeline/lfs_nogogit.go +++ b/modules/git/pipeline/lfs_nogogit.go @@ -72,7 +72,7 @@ func FindLFSFile(repo *git.Repository, hash git.SHA1) ([]*LFSResult, error) { fnameBuf := make([]byte, 4096) modeBuf := make([]byte, 40) - workingShaBuf := make([]byte, 40) + workingShaBuf := make([]byte, 20) for scan.Scan() { // Get the next commit ID @@ -140,7 +140,9 @@ func FindLFSFile(repo *git.Repository, hash git.SHA1) ([]*LFSResult, error) { } resultsMap[curCommit.ID.String()+":"+curPath+string(fname)] = &result } else if string(mode) == git.EntryModeTree.String() { - trees = append(trees, git.To40ByteSHA(sha20byte)) + sha40Byte := make([]byte, 40) + git.To40ByteSHA(sha20byte, sha40Byte) + trees = append(trees, sha40Byte) paths = append(paths, curPath+string(fname)+"/") } } |