isGitTransientState method
Check if we're in a transient git state (rebase, merge, cherry-pick).
Implementation
Future<bool> isGitTransientState() async {
final gitDir = await resolveGitDir?.call(getAttributionRepoRoot());
if (gitDir == null) return false;
const indicators = [
'rebase-merge',
'rebase-apply',
'MERGE_HEAD',
'CHERRY_PICK_HEAD',
'BISECT_LOG',
];
for (final indicator in indicators) {
final entity = File('$gitDir/$indicator');
if (await entity.exists()) return true;
final dir = Directory('$gitDir/$indicator');
if (await dir.exists()) return true;
}
return false;
}