Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

docs: TODO deferred merge-stats split and squash-preview coverage (#3563)

Maximilian Roose2b956370119
diff --git a/src/commands/step/squash.rs b/src/commands/step/squash.rs
index fc4cb04e6..e06eb9803 100644
--- a/src/commands/step/squash.rs
+++ b/src/commands/step/squash.rs
@@ -370,6 +370,10 @@ fn preview_squash(target: Option<&str>, dry_run: bool, yes: bool) -> anyhow::Res
let integration_target = repo.require_target_ref(target)?;
// #3519: preview against the same upstream-aware span the real squash uses.
+ // TODO(#3519 follow-up): unlike `handle_squash`, this path (--dry-run /
+ // --show-prompt) has no test asserting it measures against the stale
+ // target's upstream — a snapshot test pinning the preview output in that
+ // topology would close the one unasserted consumer of `span_upstream`.
let span_target = repo
.span_upstream(&integration_target)?
.unwrap_or(integration_target);
diff --git a/src/commands/worktree/push.rs b/src/commands/worktree/push.rs
index 1ad7a3f2c..41d30327a 100644
--- a/src/commands/worktree/push.rs
+++ b/src/commands/worktree/push.rs
@@ -124,6 +124,13 @@ impl MergeContext {
let stash_guard =
repo.prepare_target_worktree(target_worktree_path.as_ref(), &target_branch)?;
+ // TODO(#3519 follow-up): when `target_branch` was behind its upstream
+ // (see `Repository::span_upstream`), this count mixes the carried
+ // fast-forwarded upstream commits in with the branch's own squash
+ // commit, so the success line ("Merged to main (N commits, ...)")
+ // overstates what the branch itself contributed. Splitting them needs
+ // a carried-count threaded through `MergeContext`; deferred as
+ // cosmetic.
let commit_count = repo.count_commits(&target_branch, "HEAD")?;
let stats_summary = if commit_count > 0 {