fix: root content_addres updates properly
This commit is contained in:
parent
780bb4e372
commit
8f2ca44ad7
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user