Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions snapshot/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -824,15 +824,13 @@ func (snap *Builder) computeContent(idx int, chunker *chunkers.Chunker, cachedPa
}

if cachedPath != nil && cachedPath.ObjectMAC != (objects.MAC{}) {
if snap.repository.BlobExists(resources.RT_OBJECT, cachedPath.ObjectMAC) {
return &contentMeta{
ObjectMAC: cachedPath.ObjectMAC,
Size: cachedPath.FileInfo.Size(),
Chunks: cachedPath.Chunks,
Entropy: cachedPath.Entropy,
ContentType: cachedPath.ContentType,
}, nil
}
return &contentMeta{
ObjectMAC: cachedPath.ObjectMAC,
Size: cachedPath.FileInfo.Size(),
Chunks: cachedPath.Chunks,
Comment thread
poolpOrg marked this conversation as resolved.
Entropy: cachedPath.Entropy,
ContentType: cachedPath.ContentType,
}, nil
}

obj, objMAC, dataSize, err := snap.chunkify(idx, chunker, record.Pathname, record.Reader, record.IsXattr)
Expand All @@ -856,7 +854,7 @@ func (snap *Builder) writeDirectoryEntry(idx int, sourceCtx *sourceContext, cach
dirEntry := vfs.NewEntry(path.Dir(record.Pathname), record)
var dirEntryMAC objects.MAC

if cachedPath != nil && snap.repository.BlobExists(resources.RT_VFS_ENTRY, cachedPath.MAC) {
if cachedPath != nil {
dirEntryMAC = cachedPath.MAC
serialized, err := dirEntry.ToBytes()
if err != nil {
Expand Down Expand Up @@ -897,7 +895,7 @@ func (snap *Builder) writeFileEntry(idx int, sourceCtx *sourceContext, meta *con
var serializedFileEntry []byte
var err error

if cachedPath != nil && snap.repository.BlobExists(resources.RT_VFS_ENTRY, cachedPath.MAC) {
if cachedPath != nil {
fileEntryMAC = cachedPath.MAC
if fileEntry.Object == (objects.MAC{}) && cachedPath.ObjectMAC != (objects.MAC{}) {
fileEntry.Object = cachedPath.ObjectMAC
Expand Down
Loading