diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-04-22 00:31:59 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-21 18:31:59 +0200 |
commit | 2255afffad4ff8173c73b7cec8dbd66d986eaf5c (patch) | |
tree | 92cd1967c9f264f1dd3016c512aea11fb37dfd39 /modules/git/pipeline | |
parent | 9b8ffa1c7a886e3b550c64799463a5d4f965a2f7 (diff) | |
download | gitea-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/pipeline')
-rw-r--r-- | modules/git/pipeline/lfs_nogogit.go | 3 |
1 files changed, 2 insertions, 1 deletions
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), |