()
| 665 | * The shallow file lives in commonDir, not the per-worktree gitDir. |
| 666 | */ |
| 667 | export async function isShallowClone(): Promise<boolean> { |
| 668 | const gitDir = await resolveGitDir() |
| 669 | if (!gitDir) { |
| 670 | return false |
| 671 | } |
| 672 | const commonDir = (await getCommonDir(gitDir)) ?? gitDir |
| 673 | try { |
| 674 | await stat(join(commonDir, 'shallow')) |
| 675 | return true |
| 676 | } catch { |
| 677 | return false |
| 678 | } |
| 679 | } |
| 680 | |
| 681 | /** |
| 682 | * Count worktrees by reading <commonDir>/worktrees/ directory. |
nothing calls this directly
no test coverage detected