MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / isGitTransientState

Function isGitTransientState

source code/utils/commitAttribution.ts:845–869  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

resolveGitDirFunction · 0.85
getAttributionRepoRootFunction · 0.85
statFunction · 0.85

Tested by

no test coverage detected