Showing the changes to git-diff/src (2 of 3 files). Show all
Unified · Split
| @@ -178,6 +178,7 @@ fn catchup_rhs_with_lhs<R: visit::Record>( · 177 unmodified lines | |||
| 178 | Some(Ok(rhs)) => match lhs.filename.cmp(rhs.filename) { | 178 | Some(Ok(rhs)) => match lhs.filename.cmp(rhs.filename) { |
| 179 | Equal => { | 179 | Equal => { |
| 180 | let rhs = rhs_entries.next().transpose()?.expect("the peeked item tobe present"); | 180 | let rhs = rhs_entries.next().transpose()?.expect("the peeked item tobe present"); |
| 181 | delegate.pop_path_component(); | ||
| 181 | handle_lhs_and_rhs_with_equal_filenames(lhs, rhs, queue, delegate)?; | 182 | handle_lhs_and_rhs_with_equal_filenames(lhs, rhs, queue, delegate)?; |
| 182 | break; | 183 | break; |
| 183 | } | 184 | } |
| @@ -217,6 +218,7 @@ fn catchup_lhs_with_rhs<R: visit::Record>( · 33 unmodified lines | |||
| 217 | Some(Ok(lhs)) => match lhs.filename.cmp(rhs.filename) { | 218 | Some(Ok(lhs)) => match lhs.filename.cmp(rhs.filename) { |
| 218 | Equal => { | 219 | Equal => { |
| 219 | let lhs = lhs_entries.next().expect("the peeked item to be present")?; | 220 | let lhs = lhs_entries.next().expect("the peeked item to be present")?; |
| 221 | delegate.pop_path_component(); | ||
| 220 | handle_lhs_and_rhs_with_equal_filenames(lhs, rhs, queue, delegate)?; | 222 | handle_lhs_and_rhs_with_equal_filenames(lhs, rhs, queue, delegate)?; |
| 221 | break; | 223 | break; |
| 222 | } | 224 | } |
| @@ -27,9 +27,12 @@ impl<P: Clone + Default> State<P> { · 26 unmodified lines | |||
| 27 | 27 | ||
| 28 | pub struct Changes<'a>(Option<immutable::TreeIter<'a>>); | 28 | pub struct Changes<'a>(Option<immutable::TreeIter<'a>>); |
| 29 | 29 | ||
| 30 | impl<'a> From<Option<immutable::TreeIter<'a>>> for Changes<'a> { | 30 | impl<'a, T> From<T> for Changes<'a> |
| 31 | fn from(v: Option<immutable::TreeIter<'a>>) -> Self { | 31 | where |
| 32 | Changes(v) | 32 | T: Into<Option<immutable::TreeIter<'a>>>, |
| 33 | { | ||
| 34 | fn from(v: T) -> Self { | ||
| 35 | Changes(v.into()) | ||
| 33 | } | 36 | } |
| 34 | } | 37 | } |
| 35 | 38 | ||