Skip to main content

merge_adds_nothing

Function merge_adds_nothing 

Source
pub fn merge_adds_nothing(one: &str, other: &str) -> Result<bool>
Expand description

Whether merging other into one would bring nothing new - every change it carries is already there, whatever the commit graphs look like.

A squash merge rewrites a branch’s commits into one whose patch id matches none of the originals, so comparing commits (even with --cherry-pick) reports them as missing long after the work has landed. Comparing trees directly is not enough either: any unrelated commit alongside the squash makes the trees differ again while the remote still adds nothing. A three-way merge asks the question the caller actually has, and needs no knowledge of how the merge upstream was done.

A merge that conflicts is a real divergence, and reads as false.