()
| 782 | * Check if we're in a transient git state (rebase, merge, cherry-pick). |
| 783 | */ |
| 784 | export async function isGitTransientState(): Promise<boolean> { |
| 785 | const gitDir = await resolveGitDir(getAttributionRepoRoot()) |
| 786 | if (!gitDir) return false |
| 787 | |
| 788 | const indicators = [ |
| 789 | 'rebase-merge', |
| 790 | 'rebase-apply', |
| 791 | 'MERGE_HEAD', |
| 792 | 'CHERRY_PICK_HEAD', |
| 793 | 'BISECT_LOG', |
| 794 | ] |
| 795 | |
| 796 | const results = await Promise.all( |
| 797 | indicators.map(async indicator => { |
| 798 | try { |
| 799 | await stat(join(gitDir, indicator)) |
| 800 | return true |
| 801 | } catch { |
| 802 | return false |
| 803 | } |
| 804 | }), |
| 805 | ) |
| 806 | |
| 807 | return results.some(exists => exists) |
| 808 | } |
| 809 | |
| 810 | /** |
| 811 | * Convert attribution state to snapshot message for persistence. |
nothing calls this directly
no test coverage detected