(filepath: string, ctx: InstanceContext)
| 16 | * Paths within the worktree but outside the working directory should not trigger external_directory permission. |
| 17 | */ |
| 18 | export function containsPath(filepath: string, ctx: InstanceContext): boolean { |
| 19 | if (FSUtil.contains(ctx.directory, filepath)) return true |
| 20 | // Non-git projects set worktree to "/" which would match ANY absolute path. |
| 21 | // Skip worktree check in this case to preserve external_directory permissions. |
| 22 | if (ctx.worktree === "/") return false |
| 23 | return FSUtil.contains(ctx.worktree, filepath) |
| 24 | } |
no outgoing calls
no test coverage detected