Source: public before-state shown in Plannotator PR #1117, Apache-2.0.
const rel = normalizeWorkspacePath(relative(repo.cwd, filePath));
if (rel && !rel.startsWith("..") && !rel.startsWith("/")) {
return `${normalizeWorkspacePath(repo.label)}/${rel}`;
}The code is short and readable, but this required case fails:
const rel = "L:/repos/project/src/file.ts";
expect(isRepoRelative(rel)).toBe(false);On Windows, path.relative() can return that absolute form when the base and
target are on different drives. The predicate accepts it and prefixes a
repository label.