mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-11-14 00:07:00 +01:00
fix: count dollar-prefixed directories as literal paths
This commit is contained in:
1 parent
d4b9fd85e7
commit
7ffbfd09d7
2 files changed
+8
-1
No files matched your search
@@ -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] },
|
||||
] } } },
|
||||
|
||||
Reference in new issue
Block a user