fix: root content_addres updates properly

This commit is contained in:
Jeremy Wall 2025-07-01 15:40:38 -05:00
parent 780bb4e372
commit 8f2ca44ad7

View File

@ -151,11 +151,6 @@ impl Graph {
/// The reference ID is calculated from the content address, name, and any dependents,
/// ensuring that it's truly content-addressable.
pub fn update_object_reference(&mut self, name: &String, new_content: Vec<u8>) -> Result<(), String> {
// Update the root reference if needed
if name == &self.root.name {
self.root = self.refs.get(name).unwrap().clone();
return Ok(());
}
// Create a mutable copy of our maps
let mut refs = HashMap::new();
for (k, v) in self.refs.as_ref() {