MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / conflict_next

Method conflict_next

atomic-core/src/output/repo/writer.rs:441–457  ·  view source on GitHub ↗
(&mut self, id: usize, changes: Option<&[Hash]>)

Source from the content-addressed store, hash-verified

439 }
440
441 fn conflict_next(&mut self, id: usize, changes: Option<&[Hash]>) -> Result<(), std::io::Error> {
442 let hash = changes.and_then(|c| c.first());
443
444 // Add hash to the existing conflict record
445 if let Some(h) = hash {
446 if let Some(conflict) = self
447 .conflicts
448 .iter_mut()
449 .rev()
450 .find(|c| c.id == Some(id as u32))
451 {
452 conflict.changes.push(*h);
453 }
454 }
455
456 self.write_marker(markers::SEPARATOR, id as u32, hash)
457 }
458
459 fn end_conflict(&mut self, id: usize) -> Result<(), std::io::Error> {
460 self.write_marker(markers::END, id as u32, None)

Callers 5

output_graph_contentFunction · 0.45
test_multiple_conflictsFunction · 0.45

Calls 3

iter_mutMethod · 0.80
write_markerMethod · 0.80
pushMethod · 0.45

Tested by 3

test_multiple_conflictsFunction · 0.36