fix: count dollar-prefixed directories as literal paths

This commit is contained in:
Thomas Durieux committed 2026-11-03 15:09:10 +00:00
1 parent d4b9fd85e7
commit 7ffbfd09d7
2 files changed
+8 -1

No files matched your search

+1 -1
View File
@@ -30,7 +30,7 @@ export async function folderCounts(repo: Repository, requestedPath: unknown): Pr
...(originalPath ? { $or: [{ path: originalPath }, { path: { $regex: "^" + escapedPrefix } }] } : {}),
} },
{ $project: { child: { $cond: [
{ $eq: ["$path", originalPath] }, "",
{ $eq: ["$path", { $literal: originalPath }] }, "",
{ $arrayElemAt: [{ $split: [{ $substrCP: ["$path", prefixLength,
{ $subtract: [{ $strLenCP: "$path" }, prefixLength] }] }, "/"] }, 0] },
] } } },