History

Merge pull request #2438 from mystor/push-wvvuuwmrwlul

Sebastian Thiel committed 8 months ago

Commit e441fa92 parents 93f39fb e63d4872 files · +19 −13Browse files

Unified · Split

2 files
  1. gix-diff/src/tree/function.rs +16 −10
  2. gix-pack/tests/pack/data/output/count_and_entries.rs +3 −3
gix-diff/src/tree/function.rs+16−10
@@ -300,9 +300,14 @@ fn handle_lhs_and_rhs_with_equal_filenames( · 299 unmodified lines
300300 ) -> Result<(), Error> {
301301 match (lhs.mode.is_tree(), rhs.mode.is_tree()) {
302302 (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
306311 .visit(Change::Modification {
307312 previous_entry_mode: lhs.mode,
308313 previous_oid: lhs.oid.to_owned(),
@@ -310,14 +315,15 @@ fn handle_lhs_and_rhs_with_equal_filenames( · 1 unmodified line
310315 oid: rhs.oid.to_owned(),
311316 })
312317 .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+ ));
315326 }
316− queue.push_back((
317− Some(lhs.oid.to_owned()),
318− Some(rhs.oid.to_owned()),
319− relation_to_propagate,
320− ));
321327 }
322328 (_, true) => {
323329 delegate.push_back_tracked_path_component(lhs.filename);
gix-pack/tests/pack/data/output/count_and_entries.rs+3−3
@@ -146,7 +146,7 @@ fn traversals() -> crate::Result { · 145 unmodified lines
146146 output::count::objects::Outcome {
147147 input_objects: 1,
148148 expanded_objects: 102,
149− decoded_objects: 18,
149+ decoded_objects: 10,
150150 total_objects: 103,
151151 },
152152 output::entry::iter_from_counts::Outcome {
@@ -179,7 +179,7 @@ fn traversals() -> crate::Result { · 26 unmodified lines
179179 output::count::objects::Outcome {
180180 input_objects: 1,
181181 expanded_objects: 102,
182− decoded_objects: 18,
182+ decoded_objects: 10,
183183 total_objects: 103,
184184 },
185185 output::entry::iter_from_counts::Outcome {
@@ -221,7 +221,7 @@ fn traversals() -> crate::Result { · 35 unmodified lines
221221 output::count::objects::Outcome {
222222 input_objects: 16,
223223 expanded_objects: 866,
224− decoded_objects: 208,
224+ decoded_objects: 74,
225225 total_objects: 868,
226226 },
227227 output::entry::iter_from_counts::Outcome {