From 2255afffad4ff8173c73b7cec8dbd66d986eaf5c Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 22 Apr 2021 00:31:59 +0800 Subject: Fix lfs management find (#15537) Fix #15236 * Do not do 40byte conversion within ParseTreeLine * Missed a to40ByteSHA Signed-off-by: Andrew Thornton Co-authored-by: Andrew Thornton --- modules/git/pipeline/lfs_nogogit.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules/git/pipeline') diff --git a/modules/git/pipeline/lfs_nogogit.go b/modules/git/pipeline/lfs_nogogit.go index f6faa3a48a..79f7528d33 100644 --- a/modules/git/pipeline/lfs_nogogit.go +++ b/modules/git/pipeline/lfs_nogogit.go @@ -127,11 +127,12 @@ func FindLFSFile(repo *git.Repository, hash git.SHA1) ([]*LFSResult, error) { case "tree": var n int64 for n < size { - mode, fname, sha, count, err := git.ParseTreeLine(batchReader, modeBuf, fnameBuf, workingShaBuf) + mode, fname, sha20byte, count, err := git.ParseTreeLine(batchReader, modeBuf, fnameBuf, workingShaBuf) if err != nil { return nil, err } n += int64(count) + sha := git.To40ByteSHA(sha20byte) if bytes.Equal(sha, []byte(hashStr)) { result := LFSResult{ Name: curPath + string(fname), -- cgit v1.2.3