diff --git a/lib/src/tree_builder.rs b/lib/src/tree_builder.rs index 66c1582a6..1dfe7ddcf 100644 --- a/lib/src/tree_builder.rs +++ b/lib/src/tree_builder.rs @@ -50,10 +50,6 @@ impl TreeBuilder { self.store.as_ref() } - pub fn has_overrides(&self) -> bool { - !self.overrides.is_empty() - } - pub fn set(&mut self, path: RepoPath, value: TreeValue) { assert!(!path.is_root()); self.overrides.insert(path, Override::Replace(value)); diff --git a/lib/src/working_copy.rs b/lib/src/working_copy.rs index f7461867d..15f36668b 100644 --- a/lib/src/working_copy.rs +++ b/lib/src/working_copy.rs @@ -717,8 +717,9 @@ impl TreeState { } }); trace_span!("write tree").in_scope(|| { - is_dirty |= tree_builder.has_overrides(); - self.tree_id = tree_builder.write_tree(); + let new_tree_id = tree_builder.write_tree(); + is_dirty |= new_tree_id != self.tree_id; + self.tree_id = new_tree_id; }); if cfg!(debug_assertions) { let tree = self.current_tree().unwrap();