mirror of
https://github.com/restic/restic.git
synced 2026-11-03 14:05:33 +00:00
repository: remove redundant cleanup code
The temp files used by the packer manager are either delete after creation (unix) or marked as delete on close (windows). Thus, no explicit cleanup is necessary.
This commit is contained in:
1 parent
0ddb4441d7
commit
80ed863aab
2 files changed
-18
No files matched your search
@@ -6,7 +6,6 @@ import (
|
||||
"crypto/sha256"
|
||||
"io"
|
||||
"os"
|
||||
"runtime"
|
||||
"sync"
|
||||
|
||||
"github.com/restic/restic/internal/backend"
|
||||
@@ -186,14 +185,6 @@ func (r *Repository) savePacker(ctx context.Context, t restic.BlobType, p *packe
|
||||
return errors.Wrap(err, "close tempfile")
|
||||
}
|
||||
|
||||
// on windows the tempfile is automatically deleted on close
|
||||
if runtime.GOOS != "windows" {
|
||||
err = fs.RemoveIfExists(p.tmpfile.Name())
|
||||
if err != nil {
|
||||
return errors.WithStack(err)
|
||||
}
|
||||
}
|
||||
|
||||
// update blobs in the index
|
||||
debug.Log(" updating blobs %v to pack %v", p.Packer.Blobs(), id)
|
||||
r.idx.StorePack(id, p.Packer.Blobs())
|
||||
|
||||
Reference in new issue
Block a user