| @@ -300,9 +300,14 @@ fn handle_lhs_and_rhs_with_equal_filenames( · 299 unmodified lines |
| 300 | ) -> Result<(), Error> { | 300 | ) -> Result<(), Error> { |
| 301 | match (lhs.mode.is_tree(), rhs.mode.is_tree()) { | 301 | match (lhs.mode.is_tree(), rhs.mode.is_tree()) { |
| 302 | (true, true) => { | 302 | (true, true) => { |
| 303 | delegate.push_back_tracked_path_component(lhs.filename); | 303 | if lhs.oid == rhs.oid { |
| 304 | if lhs.oid != rhs.oid | 304 | // If the tree oids are identical, we won't bother recursing |
| 305 | && delegate | 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 | .visit(Change::Modification { | 311 | .visit(Change::Modification { |
| 307 | previous_entry_mode: lhs.mode, | 312 | previous_entry_mode: lhs.mode, |
| 308 | previous_oid: lhs.oid.to_owned(), | 313 | previous_oid: lhs.oid.to_owned(), |
| @@ -310,14 +315,15 @@ fn handle_lhs_and_rhs_with_equal_filenames( · 1 unmodified line |
| 310 | oid: rhs.oid.to_owned(), | 315 | oid: rhs.oid.to_owned(), |
| 311 | }) | 316 | }) |
| 312 | .is_break() | 317 | .is_break() |
| 313 | { | 318 | { |
| 314 | return Err(Error::Cancelled); | 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 | (_, true) => { | 328 | (_, true) => { |
| 323 | delegate.push_back_tracked_path_component(lhs.filename); | 329 | delegate.push_back_tracked_path_component(lhs.filename); |