mirror of
https://github.com/restic/restic.git
synced 2025-12-15 18:32:25 +00:00
archiver: fix file type change test
The test did not test the case that the type of a file changed unexpectedly.
This commit is contained in:
@@ -369,7 +369,7 @@ func (arch *Archiver) dirToNodeAndEntries(snPath, dir string, meta fs.File) (nod
|
||||
return nil, nil, err
|
||||
}
|
||||
if node.Type != restic.NodeTypeDir {
|
||||
return nil, nil, fmt.Errorf("directory %v changed type, refusing to archive", snPath)
|
||||
return nil, nil, fmt.Errorf("directory %q changed type, refusing to archive", snPath)
|
||||
}
|
||||
|
||||
names, err = meta.Readdirnames(-1)
|
||||
@@ -548,7 +548,7 @@ func (arch *Archiver) save(ctx context.Context, snPath, target string, previous
|
||||
|
||||
// make sure it's still a file
|
||||
if !fi.Mode().IsRegular() {
|
||||
err = errors.Errorf("file %v changed type, refusing to archive", target)
|
||||
err = errors.Errorf("file %q changed type, refusing to archive", target)
|
||||
return filterError(err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user