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