Skip to content

Commit e20122a

Browse files
Byroncodex
andcommitted
review
Co-authored-by: GPT 5.5 <codex@openai.com>
1 parent cd028f4 commit e20122a

2 files changed

Lines changed: 20 additions & 12 deletions

File tree

gix-blame/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ smallvec = "1.15.1"
3939
thiserror = "2.0.18"
4040

4141
[dev-dependencies]
42-
gix-hash = { version = "^0.23.0", path = "../gix-hash", features = ["sha1", "sha256"] }
43-
gix-ref = { path = "../gix-ref" }
42+
gix-hash = { path = "../gix-hash", features = ["sha1", "sha256"] }
43+
gix-ref = { path = "../gix-ref", features = ["sha1", "sha256"] }
4444
gix-filter = { path = "../gix-filter" }
4545
gix-fs = { path = "../gix-fs" }
46-
gix-index = { path = "../gix-index" }
47-
gix-odb = { path = "../gix-odb" }
46+
gix-index = { path = "../gix-index", features = ["sha1"] }
47+
gix-odb = { path = "../gix-odb", features = ["sha1"] }
4848
gix-testtools = { path = "../tests/tools" }
4949
pretty_assertions = "1.4.0"
5050

gix-blame/tests/blame.rs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ use gix_blame::BlameRanges;
44
use gix_hash::ObjectId;
55
use gix_object::bstr;
66

7+
fn fixture_hash_kind() -> gix_hash::Kind {
8+
gix_testtools::hash_kind_from_env().unwrap_or_default()
9+
}
10+
711
struct Baseline<'a> {
812
lines: bstr::Lines<'a>,
913
filenames: BTreeMap<ObjectId, bstr::BString>,
@@ -16,7 +20,7 @@ mod baseline {
1620
use gix_hash::ObjectId;
1721
use gix_ref::bstr::ByteSlice;
1822

19-
use super::Baseline;
23+
use super::{fixture_hash_kind, Baseline};
2024

2125
// These fields are used by `git` in its porcelain output.
2226
const HEADER_FIELDS: [&str; 12] = [
@@ -73,7 +77,7 @@ mod baseline {
7377

7478
fn next(&mut self) -> Option<Self::Item> {
7579
let mut ranges = None;
76-
let mut commit_id = gix_testtools::hash_kind_from_env().unwrap_or_default().null();
80+
let mut commit_id = fixture_hash_kind().null();
7781
let mut skip_lines: u32 = 0;
7882
let mut source_file_name: Option<gix_object::bstr::BString> = None;
7983

@@ -155,19 +159,23 @@ impl Fixture {
155159
fn for_worktree_path(worktree_path: PathBuf) -> gix_testtools::Result<Fixture> {
156160
use gix_ref::store::WriteReflog;
157161

162+
let object_hash = fixture_hash_kind();
158163
let store = gix_ref::file::Store::at(
159164
worktree_path.join(".git"),
160165
gix_ref::store::init::Options {
161166
write_reflog: WriteReflog::Disable,
167+
object_hash,
162168
..Default::default()
163169
},
164170
);
165-
let object_hash = gix_testtools::hash_kind_from_env().unwrap_or_default();
166-
let options = gix_odb::store::init::Options {
167-
object_hash,
168-
..Default::default()
169-
};
170-
let odb = gix_odb::at_opts(worktree_path.join(".git/objects"), Vec::new(), options)?;
171+
let odb = gix_odb::at_opts(
172+
worktree_path.join(".git/objects"),
173+
Vec::new(),
174+
gix_odb::store::init::Options {
175+
object_hash,
176+
..Default::default()
177+
},
178+
)?;
171179

172180
let mut reference = gix_ref::file::Store::find(&store, "HEAD")?;
173181

0 commit comments

Comments
 (0)