feat: add ecc2 bulk worktree merge actions

This commit is contained in:
Affaan Mustafa
2026-04-08 15:04:52 -07:00
parent 4834dfd280
commit e6460534e3
5 changed files with 457 additions and 10 deletions

View File

@@ -297,13 +297,17 @@ pub fn health(worktree: &WorktreeInfo) -> Result<WorktreeHealth> {
}
}
pub fn has_uncommitted_changes(worktree: &WorktreeInfo) -> Result<bool> {
Ok(!git_status_short(&worktree.path)?.is_empty())
}
pub fn merge_into_base(worktree: &WorktreeInfo) -> Result<MergeOutcome> {
let readiness = merge_readiness(worktree)?;
if readiness.status == MergeReadinessStatus::Conflicted {
anyhow::bail!(readiness.summary);
}
if !git_status_short(&worktree.path)?.is_empty() {
if has_uncommitted_changes(worktree)? {
anyhow::bail!(
"Worktree {} has uncommitted changes; commit or discard them before merging",
worktree.branch