mirror of
https://github.com/restic/restic.git
synced 2026-02-23 01:06:23 +00:00
Refactor Index.Lookup() to return struct PackedBlob
This commit is contained in:
6
node.go
6
node.go
@@ -212,14 +212,14 @@ func (node Node) createFileAt(path string, repo *repository.Repository) error {
|
||||
|
||||
var buf []byte
|
||||
for _, id := range node.Content {
|
||||
_, _, _, length, err := repo.Index().Lookup(id)
|
||||
blob, err := repo.Index().Lookup(id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
buf = buf[:cap(buf)]
|
||||
if uint(len(buf)) < length {
|
||||
buf = make([]byte, length)
|
||||
if uint(len(buf)) < blob.Length {
|
||||
buf = make([]byte, blob.Length)
|
||||
}
|
||||
|
||||
buf, err := repo.LoadBlob(pack.Data, id, buf)
|
||||
|
||||
Reference in New Issue
Block a user