Skip to content

Commit 13f3647

Browse files
committed
chore: construct gix::blame::Options via Default in CLI and it; fix build after private field
1 parent ada1cbb commit 13f3647

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

gix-ref/src/name.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ impl<'a> convert::TryFrom<&'a str> for PartialName {
221221
}
222222
}
223223

224-
#[allow(clippy::infallible_try_from)]
224+
#[allow(clippy::fallible_impl_from)]
225225
impl<'a> convert::TryFrom<&'a FullName> for &'a PartialNameRef {
226226
type Error = Infallible;
227227

src/plumbing/main.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,12 +1603,14 @@ pub fn main() -> Result<()> {
16031603
core::repository::blame::blame_file(
16041604
repo,
16051605
&file,
1606-
gix::blame::Options {
1607-
diff_algorithm,
1608-
range: gix::blame::BlameRanges::from_ranges(ranges),
1609-
since,
1610-
rewrites: Some(gix::diff::Rewrites::default()),
1611-
debug_track_path: false,
1606+
{
1607+
let mut opts = gix::blame::Options::default();
1608+
opts.diff_algorithm = diff_algorithm;
1609+
opts.range = gix::blame::BlameRanges::from_ranges(ranges);
1610+
opts.since = since;
1611+
opts.rewrites = Some(gix::diff::Rewrites::default());
1612+
opts.debug_track_path = false;
1613+
opts
16121614
},
16131615
out,
16141616
statistics.then_some(err),

tests/it/src/commands/blame_copy_royal.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,12 @@ pub(super) mod function {
3535
let mut resource_cache = repo.diff_resource_cache_for_tree_diff()?;
3636
let diff_algorithm = repo.diff_algorithm()?;
3737

38-
let options = gix::blame::Options {
39-
diff_algorithm,
40-
range: gix::blame::BlameRanges::default(),
41-
since: None,
42-
rewrites: Some(gix::diff::Rewrites::default()),
43-
debug_track_path: true,
44-
};
38+
let mut options = gix::blame::Options::default();
39+
options.diff_algorithm = diff_algorithm;
40+
options.range = gix::blame::BlameRanges::default();
41+
options.since = None;
42+
options.rewrites = Some(gix::diff::Rewrites::default());
43+
options.debug_track_path = true;
4544

4645
let index = repo.index_or_empty()?;
4746

0 commit comments

Comments
 (0)