fix: if root return a file with that set

This commit is contained in:
Derrick Hammer 2024-03-07 16:48:56 -05:00
parent 6e97b582ba
commit 8a6516e157
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 9 additions and 0 deletions

View File

@ -72,6 +72,15 @@ func (w *dirFs) openDirectly(name string, dir *metadata.DirectoryMetadata) (fs.F
}), nil
}
if name == "." {
return w.s5.newFile(FileParams{
Hash: w.root.Hash.HashBytes(),
Type: w.root.Type,
Name: name,
}), nil
}
return nil, fs.ErrNotExist
}