Skip to content

Commit

Permalink
Fix path for hash mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
ligustah committed May 15, 2024
1 parent 91ab53a commit 7172a4a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ where
if self_node.hash != other_node.hash {
path.push(self_node.value.clone());
let mut children_diff = self_node.diff(path, other_node);
path.pop();

// if there are no diffs in the children, it likely means that the tree is
// cut off further down. In that case we will mark the bottom-most node
Expand All @@ -357,6 +356,8 @@ where
// otherwise just add the (more specific) diffs from the children
diffs.append(&mut children_diff);
}

path.pop();
}

self_item = self_iter.next();
Expand Down Expand Up @@ -470,7 +471,7 @@ mod tests {
vec![
Diff::MissingOther(vec!["a", "b", "g"]),
Diff::MissingSelf(vec!["a", "b", "h"]),
Diff::HashMismatch(vec!["a", "b", "i"]),
Diff::HashMismatch(vec!["a", "b", "i", "6"]),
]
);
}
Expand Down

0 comments on commit 7172a4a

Please sign in to comment.