func (rw *DirRewriter) RewriteSnapshotManifest(ctx context.Context, man *snapshot.Manifest) (bool, error) {
	newEntry, err := rw.getCachedReplacement(ctx, ".", man.RootEntry)
	if err != nil {
		return false, errors.Wrapf(err, "error processing snapshot %v", man.ID)
	}

	if newEntry == nil {
		newEntry, err = rw.opts.OnDirectoryReadFailure(ctx, ".", man.RootEntry, errors.Errorf("invalid root directory %v", man.ID))
		if err != nil {
			return false, err
		}
	}

	if !rw.equalEntries(newEntry, man.RootEntry) {
		man.RootEntry = newEntry
		return true, nil
	}

	return false, nil
}
// RewriteSnapshotManifest rewrites the directory tree starting at a given manifest.
RewriteSnapshotManifest rewrites the directory tree starting at a given manifest.
// RewriteSnapshotManifest rewrites the directory tree starting at a given manifest .
func (rw *DirRewriter) RewriteSnapshotManifest(ctx context.Context, man *snapshot.Manifest) (bool, error) {
	newEntry, err := rw.getCachedReplacement(ctx, ".", man.RootEntry)
	if err != nil {
		return false, errors.Wrapf(err, "error processing snapshot %v", man.ID)
	}
	if newEntry == nil {
		newEntry, err = rw.opts.OnDirectoryReadFailure(ctx, ".", man.RootEntry, errors.Errorf("invalid root directory %v", man.ID))
		if err != nil {
			return false, err
		}
	}
	if !rw.equalEntries(newEntry, man.RootEntry) {
		man.RootEntry = newEntry
		return true, nil
	}
	return false, nil
}
func ( rw * DirRewriter ) RewriteSnapshotManifest ( ctx context . Context , man * snapshot . Manifest ) ( bool , error ) { newEntry , err := rw . getCachedReplacement ( ctx , " " , man . RootEntry ) if err != nil { return false , errors . Wrapf ( err , " " , man . ID ) } if newEntry == nil { newEntry , err = rw . opts . OnDirectoryReadFailure ( ctx , " " , man . RootEntry , errors . Errorf ( " " , man . ID ) ) if err != nil { return false , err } } if ! rw . equalEntries ( newEntry , man . RootEntry ) { man . RootEntry = newEntry return true , nil } return false , nil }
RewriteSnapshotManifest rewrites the directory tree starting at a given manifest.
RewriteSnapshotManifest rewrites the directory tree starting at a given manifest .