refactor(apple): normalize host paths at the filesystem boundary

This commit is contained in:
morluto
2026-10-08 19:09:40 +08:00
parent fe3cac8aa8
commit fb999f84b8
4 changed files with 103 additions and 9 deletions
+2 -7
View File
@@ -37,13 +37,8 @@ export const resolveTreePath = async (
if (entry.kind === "symlink") {
hops += 1;
if (hops > MAX_SYMLINK_HOPS) return { kind: "absent" };
if (
entry.target.startsWith("/") ||
/^[a-zA-Z]:[\\/]/u.test(entry.target) ||
entry.target.startsWith("\\\\") ||
entry.target.startsWith("//")
)
return { kind: "escapes" };
// Tree providers convert host link syntax to this POSIX namespace.
if (entry.target.startsWith("/")) return { kind: "escapes" };
pending.unshift(...segmentsOf(entry.target));
continue;
}