mirror of
https://github.com/pgsty/minio.git
synced 2026-08-10 00:03:29 +03:00
Unit tests for PUT object when object already exists (#1904)
* fs/xl tests for multiple put object requests * xl fix for put object on directory * Unit tests fix windows test issue.
This commit is contained in:
committed by
Harshavardhana
parent
80d83220ad
commit
4ee2136b28
+5
-3
@@ -335,9 +335,11 @@ func (xl xlObjects) PutObject(bucket string, object string, size int64, data io.
|
||||
|
||||
// Rename if an object already exists to temporary location.
|
||||
newUniqueID := getUUID()
|
||||
err = xl.renameObject(bucket, object, minioMetaBucket, path.Join(tmpMetaPrefix, newUniqueID))
|
||||
if err != nil {
|
||||
return "", toObjectErr(err, bucket, object)
|
||||
if xl.isObject(bucket, object) {
|
||||
err = xl.renameObject(bucket, object, minioMetaBucket, path.Join(tmpMetaPrefix, newUniqueID))
|
||||
if err != nil {
|
||||
return "", toObjectErr(err, bucket, object)
|
||||
}
|
||||
}
|
||||
|
||||
// Fill all the necessary metadata.
|
||||
|
||||
Reference in New Issue
Block a user