Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/commands/step/squash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 7 additions & 0 deletions src/commands/worktree/push.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading