MCPcopy Index your code
hub / github.com/codeaashu/claude-code / isGitTransientState

Function isGitTransientState

src/utils/commitAttribution.ts:843–867  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

841 * Check if we're in a transient git state (rebase, merge, cherry-pick).
842 */
843export 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.

Callers

nothing calls this directly

Calls 3

resolveGitDirFunction · 0.85
getAttributionRepoRootFunction · 0.85
statFunction · 0.85

Tested by

no test coverage detected