mirror of https://github.com/restic/restic.git
dump: Use slashes as path separators in tar on windows
This conversion is necessary as paths returned by filepath.Rel use the operating-system native path separator
This commit is contained in:
parent
bcf44a9c3f
commit
dcf9ded977
|
@ -72,7 +72,7 @@ func tarNode(ctx context.Context, tw *tar.Writer, node *restic.Node, repo restic
|
|||
}
|
||||
|
||||
header := &tar.Header{
|
||||
Name: relPath,
|
||||
Name: filepath.ToSlash(relPath),
|
||||
Size: int64(node.Size),
|
||||
Mode: int64(node.Mode),
|
||||
Uid: int(node.UID),
|
||||
|
|
|
@ -147,8 +147,9 @@ func checkTar(t *testing.T, testDir string, srcTar *bytes.Buffer) error {
|
|||
continue
|
||||
}
|
||||
|
||||
if filepath.Base(hdr.Name) != match.Name() {
|
||||
return fmt.Errorf("foldernames don't match got %v want %v", filepath.Base(hdr.Name), match.Name())
|
||||
filebase := filepath.ToSlash(match.Name())
|
||||
if filepath.Base(hdr.Name) != filebase {
|
||||
return fmt.Errorf("foldernames don't match got %v want %v", filepath.Base(hdr.Name), filebase)
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue