mirror of https://github.com/minio/minio.git
delete: Use physical Dir() for proper prefix cleanup in Windows (#9297)
In FS mode under Windows, removing an object will not automatically. remove parent empty prefixes. The reason is that path.Dir() was used, however filepath.Dir() is more appropriate since filepath is physical (meaning it operates on OS filesystem paths) This is not caught because failure for Windows CI is not caught.
This commit is contained in:
parent
2bbc6a83e8
commit
e51e465543
|
@ -1452,10 +1452,7 @@ func deleteFile(basePath, deletePath string, recursive bool) error {
|
|||
}
|
||||
}
|
||||
|
||||
// Trailing slash is removed when found to ensure
|
||||
// slashpath.Dir() to work as intended.
|
||||
deletePath = strings.TrimSuffix(deletePath, SlashSeparator)
|
||||
deletePath = slashpath.Dir(deletePath)
|
||||
deletePath = filepath.Dir(deletePath)
|
||||
|
||||
// Delete parent directory obviously not recursively. Errors for
|
||||
// parent directories shouldn't trickle down.
|
||||
|
|
Loading…
Reference in New Issue