Skip to content

Commit 006e2a6

Browse files
committed
ApplyLayer() use RemoveAll to handle removing directories
rmTargetPath can be a directory, so we have to use RemoveAll() or we will fail to whiteout non-empty directories.
1 parent eace2db commit 006e2a6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

archive/diff.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func ApplyLayer(dest string, layer Archive) error {
4949
rmTargetPath := filepath.Join(filepath.Dir(fullPath), rmTargetName)
5050
// Remove the file targeted by the whiteout
5151
log.Printf("Removing whiteout target %s", rmTargetPath)
52-
_ = os.Remove(rmTargetPath)
52+
_ = os.RemoveAll(rmTargetPath)
5353
// Remove the whiteout itself
5454
log.Printf("Removing whiteout %s", fullPath)
5555
_ = os.RemoveAll(fullPath)

0 commit comments

Comments
 (0)