Showing the changes to git-diff/src (2 of 38 files). Show all
Unified · Split
| @@ -54,13 +54,13 @@ impl<'a> tree::Changes<'a> { · 53 unmodified lines | |||
| 54 | /// [git_cmp_rs]: https://github.com/Byron/gitoxide/blob/a4d5f99c8dc99bf814790928a3bf9649cd99486b/git-object/src/mutable/tree.rs#L52-L55 | 54 | /// [git_cmp_rs]: https://github.com/Byron/gitoxide/blob/a4d5f99c8dc99bf814790928a3bf9649cd99486b/git-object/src/mutable/tree.rs#L52-L55 |
| 55 | pub fn needed_to_obtain<FindFn, R, StateMut>( | 55 | pub fn needed_to_obtain<FindFn, R, StateMut>( |
| 56 | mut self, | 56 | mut self, |
| 57 | other: git_object::tree::RefIter<'_>, | 57 | other: git_object::TreeRefIter<'_>, |
| 58 | mut state: StateMut, | 58 | mut state: StateMut, |
| 59 | mut find: FindFn, | 59 | mut find: FindFn, |
| 60 | delegate: &mut R, | 60 | delegate: &mut R, |
| 61 | ) -> Result<(), Error> | 61 | ) -> Result<(), Error> |
| 62 | where | 62 | where |
| 63 | FindFn: for<'b> FnMut(&oid, &'b mut Vec<u8>) -> Option<git_object::tree::RefIter<'b>>, | 63 | FindFn: for<'b> FnMut(&oid, &'b mut Vec<u8>) -> Option<git_object::TreeRefIter<'b>>, |
| 64 | R: tree::Visit, | 64 | R: tree::Visit, |
| 65 | StateMut: BorrowMut<tree::State>, | 65 | StateMut: BorrowMut<tree::State>, |
| 66 | { | 66 | { |
| @@ -120,7 +120,7 @@ impl<'a> tree::Changes<'a> { · 53 unmodified lines | |||
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | fn delete_entry_schedule_recursion<R: tree::Visit>( | 122 | fn delete_entry_schedule_recursion<R: tree::Visit>( |
| 123 | entry: immutable::tree::EntryRef<'_>, | 123 | entry: git_object::tree::EntryRef<'_>, |
| 124 | queue: &mut VecDeque<TreeInfoPair>, | 124 | queue: &mut VecDeque<TreeInfoPair>, |
| 125 | delegate: &mut R, | 125 | delegate: &mut R, |
| 126 | ) -> Result<(), Error> { | 126 | ) -> Result<(), Error> { |
| @@ -143,7 +143,7 @@ fn delete_entry_schedule_recursion<R: tree::Visit>( · 16 unmodified lines | |||
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | fn add_entry_schedule_recursion<R: tree::Visit>( | 145 | fn add_entry_schedule_recursion<R: tree::Visit>( |
| 146 | entry: immutable::tree::EntryRef<'_>, | 146 | entry: git_object::tree::EntryRef<'_>, |
| 147 | queue: &mut VecDeque<TreeInfoPair>, | 147 | queue: &mut VecDeque<TreeInfoPair>, |
| 148 | delegate: &mut R, | 148 | delegate: &mut R, |
| 149 | ) -> Result<(), Error> { | 149 | ) -> Result<(), Error> { |
| @@ -165,7 +165,7 @@ fn add_entry_schedule_recursion<R: tree::Visit>( · 15 unmodified lines | |||
| 165 | Ok(()) | 165 | Ok(()) |
| 166 | } | 166 | } |
| 167 | fn catchup_rhs_with_lhs<R: tree::Visit>( | 167 | fn catchup_rhs_with_lhs<R: tree::Visit>( |
| 168 | rhs_entries: &mut IteratorType<git_object::tree::RefIter<'_>>, | 168 | rhs_entries: &mut IteratorType<git_object::TreeRefIter<'_>>, |
| 169 | lhs: git_object::tree::EntryRef<'_>, | 169 | lhs: git_object::tree::EntryRef<'_>, |
| 170 | rhs: git_object::tree::EntryRef<'_>, | 170 | rhs: git_object::tree::EntryRef<'_>, |
| 171 | queue: &mut VecDeque<TreeInfoPair>, | 171 | queue: &mut VecDeque<TreeInfoPair>, |
| @@ -205,7 +205,7 @@ fn catchup_rhs_with_lhs<R: tree::Visit>( · 33 unmodified lines | |||
| 205 | } | 205 | } |
| 206 | 206 | ||
| 207 | fn catchup_lhs_with_rhs<R: tree::Visit>( | 207 | fn catchup_lhs_with_rhs<R: tree::Visit>( |
| 208 | lhs_entries: &mut IteratorType<git_object::tree::RefIter<'_>>, | 208 | lhs_entries: &mut IteratorType<git_object::TreeRefIter<'_>>, |
| 209 | lhs: git_object::tree::EntryRef<'_>, | 209 | lhs: git_object::tree::EntryRef<'_>, |
| 210 | rhs: git_object::tree::EntryRef<'_>, | 210 | rhs: git_object::tree::EntryRef<'_>, |
| 211 | queue: &mut VecDeque<TreeInfoPair>, | 211 | queue: &mut VecDeque<TreeInfoPair>, |
| @@ -245,8 +245,8 @@ fn catchup_lhs_with_rhs<R: tree::Visit>( · 33 unmodified lines | |||
| 245 | } | 245 | } |
| 246 | 246 | ||
| 247 | fn handle_lhs_and_rhs_with_equal_filenames<R: tree::Visit>( | 247 | fn handle_lhs_and_rhs_with_equal_filenames<R: tree::Visit>( |
| 248 | lhs: immutable::tree::EntryRef<'_>, | 248 | lhs: git_object::tree::EntryRef<'_>, |
| 249 | rhs: immutable::tree::EntryRef<'_>, | 249 | rhs: git_object::tree::EntryRef<'_>, |
| 250 | queue: &mut VecDeque<TreeInfoPair>, | 250 | queue: &mut VecDeque<TreeInfoPair>, |
| 251 | delegate: &mut R, | 251 | delegate: &mut R, |
| 252 | ) -> Result<(), Error> { | 252 | ) -> Result<(), Error> { |
| @@ -1,7 +1,7 @@ | |||
| 1 | use std::collections::VecDeque; | 1 | use std::collections::VecDeque; |
| 2 | 2 | ||
| 3 | use git_hash::ObjectId; | 3 | use git_hash::ObjectId; |
| 4 | use git_object::tree; | 4 | use git_object::TreeRefIter; |
| 5 | 5 | ||
| 6 | /// The state required to visit [Changes] to be instantiated with `State::default()`. | 6 | /// The state required to visit [Changes] to be instantiated with `State::default()`. |
| 7 | #[derive(Default, Clone)] | 7 | #[derive(Default, Clone)] |
| @@ -22,11 +22,11 @@ impl State { · 14 unmodified lines | |||
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | /// An iterator over changes of a tree, instantiated using `Changes::from(…)`. | 24 | /// An iterator over changes of a tree, instantiated using `Changes::from(…)`. |
| 25 | pub struct Changes<'a>(Option<tree::RefIter<'a>>); | 25 | pub struct Changes<'a>(Option<TreeRefIter<'a>>); |
| 26 | 26 | ||
| 27 | impl<'a, T> From<T> for Changes<'a> | 27 | impl<'a, T> From<T> for Changes<'a> |
| 28 | where | 28 | where |
| 29 | T: Into<Option<tree::RefIter<'a>>>, | 29 | T: Into<Option<TreeRefIter<'a>>>, |
| 30 | { | 30 | { |
| 31 | fn from(v: T) -> Self { | 31 | fn from(v: T) -> Self { |
| 32 | Changes(v.into()) | 32 | Changes(v.into()) |