fix: tree traversal issue with empty folders (#4810)

fixes #4794
This commit is contained in:
jiuker
2023-12-29 09:16:55 -08:00
committed by GitHub
parent 176f657e53
commit f88eb55911
+10
View File
@@ -195,6 +195,16 @@ func doTree(ctx context.Context, url string, timeRef time.Time, level int, branc
prefixPath = strings.TrimPrefix(prefixPath, "."+separator)
if prev.Type.IsDir() {
nextURL := ""
if targetAlias != "" {
nextURL = targetAlias + "/" + contentURL
} else {
nextURL = contentURL
}
if nextURL == url {
return nil
}
printMsg(treeMessage{
Entry: strings.TrimSuffix(strings.TrimPrefix(contentURL, prefixPath), "/"),
IsDir: true,