()
| 97 | export const findGitRoot = createFindGitRoot() |
| 98 | |
| 99 | function createFindGitRoot(): { |
| 100 | (startPath: string): string | null |
| 101 | cache: typeof findGitRootImpl.cache |
| 102 | } { |
| 103 | function wrapper(startPath: string): string | null { |
| 104 | const result = findGitRootImpl(startPath) |
| 105 | return result === GIT_ROOT_NOT_FOUND ? null : result |
| 106 | } |
| 107 | wrapper.cache = findGitRootImpl.cache |
| 108 | return wrapper |
| 109 | } |
| 110 | |
| 111 | /** |
| 112 | * Resolve a git root to the canonical main repository root. |