()
| 842 | * Check if we're in a transient git state (rebase, merge, cherry-pick). |
| 843 | */ |
| 844 | export async function isGitTransientState(): Promise<boolean> { |
| 845 | const gitDir = await resolveGitDir(getAttributionRepoRoot()) |
| 846 | if (!gitDir) return false |
| 847 | |
| 848 | const indicators = [ |
| 849 | 'rebase-merge', |
| 850 | 'rebase-apply', |
| 851 | 'MERGE_HEAD', |
| 852 | 'CHERRY_PICK_HEAD', |
| 853 | 'BISECT_LOG', |
| 854 | ] |
| 855 | |
| 856 | const results = await Promise.all( |
| 857 | indicators.map(async indicator => { |
| 858 | try { |
| 859 | await stat(join(gitDir, indicator)) |
| 860 | return true |
| 861 | } catch { |
| 862 | return false |
| 863 | } |
| 864 | }), |
| 865 | ) |
| 866 | |
| 867 | return results.some(exists => exists) |
| 868 | } |
| 869 | |
| 870 | /** |
| 871 | * Convert attribution state to snapshot message for persistence. |
nothing calls this directly
no test coverage detected