Skip to content

Commit 91a611f

Browse files
committed
refactor
- Make ports of old implementations easier - remove NewlineSeparator variants which don't seem used quite as much - it's always conditionally adding newlines.
1 parent 0924bd3 commit 91a611f

File tree

7 files changed

+426
-465
lines changed

7 files changed

+426
-465
lines changed

gitoxide-core/src/repository/diff.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
use anyhow::Context;
2+
use gix::diff::blob::unified_diff::ConsumeBinaryHunk;
23
use gix::{
34
bstr::{BString, ByteSlice},
4-
diff::blob::{
5-
intern::TokenSource,
6-
unified_diff::{ContextSize, NewlineSeparator},
7-
UnifiedDiff,
8-
},
5+
diff::blob::{intern::TokenSource, unified_diff::ContextSize, UnifiedDiff},
96
objs::tree::EntryMode,
107
odb::store::RefreshMode,
118
prelude::ObjectIdExt,
@@ -206,8 +203,7 @@ pub fn file(
206203

207204
let unified_diff = UnifiedDiff::new(
208205
&interner,
209-
String::new(),
210-
NewlineSeparator::AfterHeaderAndLine("\n"),
206+
ConsumeBinaryHunk::new(BString::default(), "\n"),
211207
ContextSize::symmetrical(3),
212208
);
213209

gix-diff/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description = "Calculate differences between various git objects"
99
authors = ["Sebastian Thiel <[email protected]>"]
1010
edition = "2021"
1111
include = ["src/**/*", "LICENSE-*"]
12-
rust-version = "1.70"
12+
rust-version = "1.74"
1313
autotests = false
1414

1515
[features]

gix-diff/src/blob/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub mod pipeline;
1212
pub mod platform;
1313

1414
pub mod unified_diff;
15-
pub use unified_diff::_impl::UnifiedDiff;
15+
pub use unified_diff::impls::UnifiedDiff;
1616

1717
/// Information about the diff performed to detect similarity.
1818
#[derive(Debug, Default, Clone, Copy, PartialEq, PartialOrd)]

0 commit comments

Comments
 (0)