| @@ -60,7 +60,7 @@ impl<'a> tree::Changes<'a> { · 59 unmodified lines |
| 60 | 60 | where |
| 61 | 61 | LocateFn: for<'b> FnMut(&oid, &'b mut Vec<u8>) -> Option<immutable::tree::TreeIter<'b>>, |
| 62 | 62 | R: tree::Visit, |
| 63 | | − StateMut: BorrowMut<tree::State<R::PathId>>, |
| 63 | + StateMut: BorrowMut<tree::State>, |
| 64 | 64 | { |
| 65 | 65 | let state = state.borrow_mut(); |
| 66 | 66 | state.clear(); |
| @@ -75,14 +75,14 @@ impl<'a> tree::Changes<'a> { · 8 unmodified lines |
| 75 | 75 | match (lhs_entries.next(), rhs_entries.next()) { |
| 76 | 76 | (None, None) => { |
| 77 | 77 | match state.trees.pop_front() { |
| 78 | | − Some((None, Some(mut rhs))) => { |
| 79 | | − delegate.set_current_path(rhs.parent_path_id.take().expect("path-id is set")); |
| 78 | + Some((None, Some(rhs))) => { |
| 79 | + delegate.pop_front_tracked_path_and_set_current(); |
| 80 | 80 | rhs_entries = peekable( |
| 81 | 81 | locate(&rhs.tree_id, &mut state.buf2).ok_or(Error::NotFound { oid: rhs.tree_id })?, |
| 82 | 82 | ); |
| 83 | 83 | } |
| 84 | | − Some((Some(mut lhs), Some(rhs))) => { |
| 85 | | − delegate.set_current_path(lhs.parent_path_id.take().expect("path-id is set in lhs")); |
| 84 | + Some((Some(lhs), Some(rhs))) => { |
| 85 | + delegate.pop_front_tracked_path_and_set_current(); |
| 86 | 86 | lhs_entries = peekable( |
| 87 | 87 | locate(&lhs.tree_id, &mut state.buf1).ok_or(Error::NotFound { oid: lhs.tree_id })?, |
| 88 | 88 | ); |
| @@ -90,8 +90,8 @@ impl<'a> tree::Changes<'a> { · 1 unmodified line |
| 90 | 90 | locate(&rhs.tree_id, &mut state.buf2).ok_or(Error::NotFound { oid: rhs.tree_id })?, |
| 91 | 91 | ); |
| 92 | 92 | } |
| 93 | | − Some((Some(mut lhs), None)) => { |
| 94 | | − delegate.set_current_path(lhs.parent_path_id.take().expect("path-id is set")); |
| 93 | + Some((Some(lhs), None)) => { |
| 94 | + delegate.pop_front_tracked_path_and_set_current(); |
| 95 | 95 | lhs_entries = peekable( |
| 96 | 96 | locate(&lhs.tree_id, &mut state.buf1).ok_or(Error::NotFound { oid: lhs.tree_id })?, |
| 97 | 97 | ); |
| @@ -125,7 +125,7 @@ impl<'a> tree::Changes<'a> { · 27 unmodified lines |
| 125 | 125 | |
| 126 | 126 | fn delete_entry_schedule_recursion<R: tree::Visit>( |
| 127 | 127 | entry: immutable::tree::Entry<'_>, |
| 128 | | − queue: &mut VecDeque<TreeInfoPair<R::PathId>>, |
| 128 | + queue: &mut VecDeque<TreeInfoPair>, |
| 129 | 129 | delegate: &mut R, |
| 130 | 130 | ) -> Result<(), Error> { |
| 131 | 131 | delegate.push_path_component(entry.filename); |
| @@ -140,7 +140,7 @@ fn delete_entry_schedule_recursion<R: tree::Visit>( · 8 unmodified lines |
| 140 | 140 | } |
| 141 | 141 | if entry.mode.is_tree() { |
| 142 | 142 | delegate.pop_path_component(); |
| 143 | | − let path_id = delegate.push_tracked_path_component(entry.filename); |
| 143 | + let path_id = delegate.push_back_tracked_path_component(entry.filename); |
| 144 | 144 | queue.push_back(( |
| 145 | 145 | Some(TreeInfo { |
| 146 | 146 | tree_id: entry.oid.to_owned(), |
| @@ -154,7 +154,7 @@ fn delete_entry_schedule_recursion<R: tree::Visit>( · 7 unmodified lines |
| 154 | 154 | |
| 155 | 155 | fn add_entry_schedule_recursion<R: tree::Visit>( |
| 156 | 156 | entry: immutable::tree::Entry<'_>, |
| 157 | | − queue: &mut VecDeque<TreeInfoPair<R::PathId>>, |
| 157 | + queue: &mut VecDeque<TreeInfoPair>, |
| 158 | 158 | delegate: &mut R, |
| 159 | 159 | ) -> Result<(), Error> { |
| 160 | 160 | delegate.push_path_component(entry.filename); |
| @@ -169,7 +169,7 @@ fn add_entry_schedule_recursion<R: tree::Visit>( · 8 unmodified lines |
| 169 | 169 | } |
| 170 | 170 | if entry.mode.is_tree() { |
| 171 | 171 | delegate.pop_path_component(); |
| 172 | | − let path_id = delegate.push_tracked_path_component(entry.filename); |
| 172 | + let path_id = delegate.push_back_tracked_path_component(entry.filename); |
| 173 | 173 | queue.push_back(( |
| 174 | 174 | None, |
| 175 | 175 | Some(TreeInfo { |
| @@ -184,7 +184,7 @@ fn catchup_rhs_with_lhs<R: tree::Visit>( · 8 unmodified lines |
| 184 | 184 | rhs_entries: &mut IteratorType<immutable::TreeIter<'_>>, |
| 185 | 185 | lhs: immutable::tree::Entry<'_>, |
| 186 | 186 | rhs: immutable::tree::Entry<'_>, |
| 187 | | − queue: &mut VecDeque<TreeInfoPair<R::PathId>>, |
| 187 | + queue: &mut VecDeque<TreeInfoPair>, |
| 188 | 188 | delegate: &mut R, |
| 189 | 189 | ) -> Result<(), Error> { |
| 190 | 190 | use std::cmp::Ordering::*; |
| @@ -224,7 +224,7 @@ fn catchup_lhs_with_rhs<R: tree::Visit>( · 33 unmodified lines |
| 224 | 224 | lhs_entries: &mut IteratorType<immutable::TreeIter<'_>>, |
| 225 | 225 | lhs: immutable::tree::Entry<'_>, |
| 226 | 226 | rhs: immutable::tree::Entry<'_>, |
| 227 | | − queue: &mut VecDeque<TreeInfoPair<R::PathId>>, |
| 227 | + queue: &mut VecDeque<TreeInfoPair>, |
| 228 | 228 | delegate: &mut R, |
| 229 | 229 | ) -> Result<(), Error> { |
| 230 | 230 | use std::cmp::Ordering::*; |
| @@ -263,13 +263,13 @@ fn catchup_lhs_with_rhs<R: tree::Visit>( · 32 unmodified lines |
| 263 | 263 | fn handle_lhs_and_rhs_with_equal_filenames<R: tree::Visit>( |
| 264 | 264 | lhs: immutable::tree::Entry<'_>, |
| 265 | 265 | rhs: immutable::tree::Entry<'_>, |
| 266 | | − queue: &mut VecDeque<TreeInfoPair<R::PathId>>, |
| 266 | + queue: &mut VecDeque<TreeInfoPair>, |
| 267 | 267 | delegate: &mut R, |
| 268 | 268 | ) -> Result<(), Error> { |
| 269 | 269 | use git_object::tree::EntryMode::*; |
| 270 | 270 | match (lhs.mode, rhs.mode) { |
| 271 | 271 | (Tree, Tree) => { |
| 272 | | − let path_id = delegate.push_tracked_path_component(lhs.filename); |
| 272 | + let path_id = delegate.push_back_tracked_path_component(lhs.filename); |
| 273 | 273 | if lhs.oid != rhs.oid |
| 274 | 274 | && delegate |
| 275 | 275 | .visit(Change::Modification { |
| @@ -294,7 +294,7 @@ fn handle_lhs_and_rhs_with_equal_filenames<R: tree::Visit>( · 18 unmodified lines |
| 294 | 294 | )); |
| 295 | 295 | } |
| 296 | 296 | (lhs_mode, Tree) if lhs_mode.is_no_tree() => { |
| 297 | | − let path_id = delegate.push_tracked_path_component(lhs.filename); |
| 297 | + let path_id = delegate.push_back_tracked_path_component(lhs.filename); |
| 298 | 298 | if delegate |
| 299 | 299 | .visit(Change::Deletion { |
| 300 | 300 | entry_mode: lhs.mode, |
| @@ -322,7 +322,7 @@ fn handle_lhs_and_rhs_with_equal_filenames<R: tree::Visit>( · 21 unmodified lines |
| 322 | 322 | )); |
| 323 | 323 | } |
| 324 | 324 | (Tree, rhs_mode) if rhs_mode.is_no_tree() => { |
| 325 | | − let path_id = delegate.push_tracked_path_component(lhs.filename); |
| 325 | + let path_id = delegate.push_back_tracked_path_component(lhs.filename); |
| 326 | 326 | if delegate |
| 327 | 327 | .visit(Change::Deletion { |
| 328 | 328 | entry_mode: lhs.mode, |