From 47befe6db1bfc786e835a2e62a5c9d1f5b82bb2a Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Thu, 25 Nov 2021 01:57:24 +0100 Subject: [PATCH] fixed id parent on root on root --- internal/types/id.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/types/id.go b/internal/types/id.go index 246ee80..3e32141 100644 --- a/internal/types/id.go +++ b/internal/types/id.go @@ -69,9 +69,15 @@ func (i ID) Parent() *ID { Key: strings.Join(parts[:len(parts)-2], "/") + "/", } } else { + dir := filepath.Dir(i.Key) + + if dir != "/" { + dir += "/" + } + parent = &ID{ Bucket: i.Bucket, - Key: filepath.Dir(i.Key) + "/", + Key: dir, } }