| @@ -300,9 +300,14 @@ fn handle_lhs_and_rhs_with_equal_filenames( · 299 unmodified lines |
| 300 | 300 | ) -> Result<(), Error> { |
| 301 | 301 | match (lhs.mode.is_tree(), rhs.mode.is_tree()) { |
| 302 | 302 | (true, true) => { |
| 303 | | − delegate.push_back_tracked_path_component(lhs.filename); |
| 304 | | − if lhs.oid != rhs.oid |
| 305 | | − && delegate |
| 303 | + if lhs.oid == rhs.oid { |
| 304 | + // If the tree oids are identical, we won't bother recursing |
| 305 | + // into this subtree as the entire tree is identical. |
| 306 | + // For path management purposes, treat it like a skipped blob. |
| 307 | + delegate.push_path_component(lhs.filename); |
| 308 | + } else { |
| 309 | + delegate.push_back_tracked_path_component(lhs.filename); |
| 310 | + if delegate |
| 306 | 311 | .visit(Change::Modification { |
| 307 | 312 | previous_entry_mode: lhs.mode, |
| 308 | 313 | previous_oid: lhs.oid.to_owned(), |
| @@ -310,14 +315,15 @@ fn handle_lhs_and_rhs_with_equal_filenames( · 1 unmodified line |
| 310 | 315 | oid: rhs.oid.to_owned(), |
| 311 | 316 | }) |
| 312 | 317 | .is_break() |
| 313 | | − { |
| 314 | | − return Err(Error::Cancelled); |
| 318 | + { |
| 319 | + return Err(Error::Cancelled); |
| 320 | + } |
| 321 | + queue.push_back(( |
| 322 | + Some(lhs.oid.to_owned()), |
| 323 | + Some(rhs.oid.to_owned()), |
| 324 | + relation_to_propagate, |
| 325 | + )); |
| 315 | 326 | } |
| 316 | | − queue.push_back(( |
| 317 | | − Some(lhs.oid.to_owned()), |
| 318 | | − Some(rhs.oid.to_owned()), |
| 319 | | − relation_to_propagate, |
| 320 | | − )); |
| 321 | 327 | } |
| 322 | 328 | (_, true) => { |
| 323 | 329 | delegate.push_back_tracked_path_component(lhs.filename); |