Simplify code for wrting SHA to name-rev (#17696)
This commit is contained in:
parent
878c2ce6e6
commit
d1f5584039
@ -217,24 +217,15 @@ func FindLFSFile(repo *git.Repository, hash git.SHA1) ([]*LFSResult, error) {
|
|||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
defer shasToNameWriter.Close()
|
defer shasToNameWriter.Close()
|
||||||
for _, result := range results {
|
for _, result := range results {
|
||||||
i := 0
|
_, err := shasToNameWriter.Write([]byte(result.SHA))
|
||||||
if i < len(result.SHA) {
|
if err != nil {
|
||||||
n, err := shasToNameWriter.Write([]byte(result.SHA)[i:])
|
errChan <- err
|
||||||
if err != nil {
|
break
|
||||||
errChan <- err
|
|
||||||
break
|
|
||||||
}
|
|
||||||
i += n
|
|
||||||
}
|
}
|
||||||
var err error
|
_, err = shasToNameWriter.Write([]byte{'\n'})
|
||||||
n := 0
|
if err != nil {
|
||||||
for n < 1 {
|
errChan <- err
|
||||||
n, err = shasToNameWriter.Write([]byte{'\n'})
|
break
|
||||||
if err != nil {
|
|
||||||
errChan <- err
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user