Skip to content

Commit d257099

Browse files
committed
adapt to changes in gix-diff
1 parent ebd4428 commit d257099

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

gix/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ revparse-regex = ["regex", "revision"]
9595

9696
## Make it possible to diff blobs line by line. Note that this feature is integral for implementing tree-diffs as well due to the handling of rename-tracking,
9797
## which relies on line-by-line diffs in some cases.
98-
blob-diff = ["gix-diff/blob"]
98+
blob-diff = ["gix-diff/blob", "attributes"]
9999

100100
## Make it possible to turn a tree into a stream of bytes, which can be decoded to entries and turned into various other formats.
101101
worktree-stream = ["gix-worktree-stream", "attributes"]

gix/src/object/tree/diff/for_each.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ pub enum Error {
1616
ConfigureDiffAlgorithm(#[from] crate::config::diff::algorithm::Error),
1717
#[error("Failure during rename tracking")]
1818
RenameTracking(#[from] tracker::emit::Error),
19+
#[error("Could not obtain worktree filter options")]
20+
PipelineOptions(#[from] crate::filter::pipeline::options::Error),
1921
}
2022

2123
///
@@ -175,6 +177,7 @@ where
175177
),
176178
},
177179
&self.src_tree.repo.objects,
180+
&mut gix_filter::Pipeline::new(crate::filter::Pipeline::options(self.src_tree.repo)?),
178181
|push| {
179182
self.src_tree
180183
.traverse()

gix/tests/object/tree/diff.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ mod track_rewrites {
420420
insertions: 1,
421421
before: 11,
422422
after: 12,
423+
similarity: 0.8888889
423424
}),
424425
"by similarity there is a diff"
425426
);
@@ -529,6 +530,7 @@ mod track_rewrites {
529530
insertions: 3,
530531
before: 12,
531532
after: 15,
533+
similarity: 0.75
532534
}),
533535
"by similarity there is a diff"
534536
);
@@ -589,12 +591,12 @@ mod track_rewrites {
589591

590592
let out = out.rewrites.expect("tracking enabled");
591593
assert_eq!(stat, None, "similarity can't run");
592-
assert_eq!(out.num_similarity_checks, 3);
594+
assert_eq!(out.num_similarity_checks, 0);
593595
assert_eq!(
594596
out.num_similarity_checks_skipped_for_rename_tracking_due_to_limit, 0,
595597
"no limit configured"
596598
);
597-
assert_eq!(out.num_similarity_checks_skipped_for_copy_tracking_due_to_limit, 57);
599+
assert_eq!(out.num_similarity_checks_skipped_for_copy_tracking_due_to_limit, 19);
598600

599601
Ok(())
600602
}
@@ -645,7 +647,7 @@ mod track_rewrites {
645647
let out = out.rewrites.expect("tracking enabled");
646648
assert_eq!(out.num_similarity_checks, 0);
647649
assert_eq!(out.num_similarity_checks_skipped_for_rename_tracking_due_to_limit, 0);
648-
assert_eq!(out.num_similarity_checks_skipped_for_copy_tracking_due_to_limit, 3);
650+
assert_eq!(out.num_similarity_checks_skipped_for_copy_tracking_due_to_limit, 2);
649651

650652
Ok(())
651653
}

0 commit comments

Comments
 (0)