Skip to content

Commit 5d85d41

Browse files
authored
Merge pull request #1423 from 0chain/hotfix/revert-name
check path and name
2 parents 1445a37 + 5196408 commit 5d85d41

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

code/go/0chain.net/blobbercore/allocation/file_changer_upload.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func (nf *UploadFileChanger) applyChange(ctx context.Context, rootRef *reference
102102
ValidationRootSignature: nf.ValidationRootSignature,
103103
CustomMeta: nf.CustomMeta,
104104
FixedMerkleRoot: nf.FixedMerkleRoot,
105-
Name: filepath.Base(nf.Path),
105+
Name: nf.Filename,
106106
Path: nf.Path,
107107
ParentPath: dirRef.Path,
108108
Type: reference.FILE,

code/go/0chain.net/blobbercore/reference/object.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func DeleteObject(ctx context.Context, rootRef *Ref, allocationID, objPath strin
6363

6464
for i, child := range dirRef.Children {
6565
basePath := filepath.Base(child.Path)
66-
if basePath == deleteFileName {
66+
if basePath == deleteFileName || child.Path == objPath {
6767
dirRef.RemoveChild(i)
6868
break
6969
}

0 commit comments

Comments
 (0)