Show More
@@ -640,7 +640,20 b' pub(super) fn write(' | |||||
640 | out: Vec::with_capacity(size_guess), |
|
640 | out: Vec::with_capacity(size_guess), | |
641 | }; |
|
641 | }; | |
642 |
|
642 | |||
643 |
let root_nodes = |
|
643 | let root_nodes = dirstate_map.root.as_ref(); | |
|
644 | for node in root_nodes.iter() { | |||
|
645 | // Catch some corruptions before we write to disk | |||
|
646 | let full_path = node.full_path(dirstate_map.on_disk)?; | |||
|
647 | let base_name = node.base_name(dirstate_map.on_disk)?; | |||
|
648 | if full_path != base_name { | |||
|
649 | let explanation = format!( | |||
|
650 | "Dirstate root node '{}' is not at the root", | |||
|
651 | full_path | |||
|
652 | ); | |||
|
653 | return Err(HgError::corrupted(explanation).into()); | |||
|
654 | } | |||
|
655 | } | |||
|
656 | let root_nodes = writer.write_nodes(root_nodes)?; | |||
644 |
|
657 | |||
645 | let unreachable_bytes = if append { |
|
658 | let unreachable_bytes = if append { | |
646 | dirstate_map.unreachable_bytes |
|
659 | dirstate_map.unreachable_bytes |
General Comments 0
You need to be logged in to leave comments.
Login now