mirror of
https://github.com/restic/restic.git
synced 2026-07-15 03:34:53 +00:00
Merge pull request #5054 from phillipp/dump-compress-zip
dump: add --compress flag to compress archives
This commit is contained in:
@@ -39,6 +39,9 @@ func (d *Dumper) dumpNodeZip(ctx context.Context, node *restic.Node, zw *zip.Wri
|
||||
Modified: node.ModTime,
|
||||
}
|
||||
header.SetMode(node.Mode)
|
||||
if node.Type == restic.NodeTypeFile {
|
||||
header.Method = zip.Deflate
|
||||
}
|
||||
|
||||
if node.Type == restic.NodeTypeDir {
|
||||
header.Name += "/"
|
||||
|
||||
@@ -101,6 +101,9 @@ func checkZip(t *testing.T, testDir string, srcZip *bytes.Buffer) error {
|
||||
return fmt.Errorf("symlink target does not match, got %s want %s", string(linkName), target)
|
||||
}
|
||||
default:
|
||||
if f.Method != zip.Deflate {
|
||||
return fmt.Errorf("expected compression method got %v want %v", f.Method, zip.Deflate)
|
||||
}
|
||||
if uint64(match.Size()) != f.UncompressedSize64 {
|
||||
return fmt.Errorf("size does not match got %v want %v", f.UncompressedSize64, match.Size())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user