diff --git a/src/cmd/stack/write.rs b/src/cmd/stack/write.rs index 876c11b..7ec8a79 100644 --- a/src/cmd/stack/write.rs +++ b/src/cmd/stack/write.rs @@ -767,13 +767,18 @@ async fn publish_branch( The branch was pushed; the knot has nothing on it that {target_branch} does not." ); } - if comparison.commits != planned.len() { + // Commits against commits. This compared the knot's count to the number + // of *members*, which was the same number only while a member was one + // commit: a stack of two members holding ten commits tripped it every + // time, and said the knot's branch had moved when nothing had. + let planned_commits: usize = planned.iter().map(|p| p.commits()).sum(); + if comparison.commits != planned_commits { crate::term::say::warning!( Knot, "{knot} counts {} commit(s) between {target_branch} and {branch}, and this \ - stack is {} — the knot's {target_branch} has moved under {remote}/{target_branch}", + stack plans {planned_commits} — the knot's {target_branch} has moved under \ + {remote}/{target_branch}", comparison.commits, - planned.len() ); } if comparison.binary_omitted {