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>
This commit is contained in:
parent
9b8ffa1c7a
commit
2255afffad
4 changed files with 7 additions and 4 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue