* Get file stats within a worktree. * * Uses `stat` (follows symlinks) to get the real file size. * Validates that the resolved path stays within the worktree boundary.
(worktreePath: string, filePath: string)
| 395 | * Validates that the resolved path stays within the worktree boundary. |
| 396 | */ |
| 397 | async stat(worktreePath: string, filePath: string): Promise<Stats> { |
| 398 | assertRegisteredWorktree(worktreePath); |
| 399 | const fullPath = resolvePathInWorktree(worktreePath, filePath); |
| 400 | await assertRealpathInWorktree(worktreePath, fullPath); |
| 401 | return stat(fullPath); |
| 402 | }, |
| 403 | |
| 404 | /** |
| 405 | * Get file stats without following symlinks. |
no test coverage detected