History

Merge pull request #2532 from cruessler/run-gix-diff-tests-with-sha-256

Use `GIX_TEST_FIXTURE_HASH` for `gix-diff`

Sebastian Thiel committed 6 months ago

Commit 7fbb9be2 parents 048e8df 3660cef11 files · +454 −239Browse files

Unified · Split

11 files
  1. Cargo.lock +1 −0
  2. gix-diff/Cargo.toml +2 −1
  3. gix-diff/src/tree/function.rs +1 −1
  4. gix-diff/tests/diff/blob/platform.rs +22 −4
  5. gix-diff/tests/diff/index.rs +18 −15
  6. gix-diff/tests/diff/main.rs +7 −13
  7. gix-diff/tests/diff/rewrites/mod.rs +10 −8
  8. gix-diff/tests/diff/rewrites/tracker.rs +220 −89
  9. gix-diff/tests/diff/tree.rs +170 −105
  10. gix-imara-diff/Cargo.toml +0 −3
  11. justfile +3 −0
Cargo.lock+1−0
@@ -1711,6 +1711,7 @@ dependencies = [ · 1710 unmodified lines
17111711 "gix-path",
17121712 "gix-pathspec",
17131713 "gix-tempfile",
1714+ "gix-testtools",
17141715 "gix-trace",
17151716 "gix-traverse",
17161717 "gix-worktree",
gix-diff/Cargo.toml+2−1
@@ -69,7 +69,8 @@ document-features = { version = "0.2.0", optional = true } · 68 unmodified lines
6969
7070 [dev-dependencies]
7171 criterion = "0.8.2"
72−gix-hash = { path = "../gix-hash", features = ["sha1"] }
72+gix-hash = { path = "../gix-hash", features = ["sha1", "sha256"] }
73+gix-testtools = { path = "../tests/tools" }
7374
7475 [package.metadata.docs.rs]
7576 all-features = true
gix-diff/src/tree/function.rs+1−1
@@ -425,7 +425,7 @@ mod tests { · 424 unmodified lines
425425
426426 #[test]
427427 fn compare_select_samples() {
428− let null = gix_hash::ObjectId::null(gix_hash::Kind::Sha1);
428+ let null = gix_testtools::hash_kind_from_env().unwrap_or_default().null();
429429 let actual = compare(
430430 &EntryRef {
431431 mode: EntryKind::Blob.into(),
gix-diff/tests/diff/blob/platform.rs+22−4
@@ -48,7 +48,11 @@ fn resources_of_worktree_and_odb_and_check_link() -> crate::Result { · 47 unmodified lines
4848 assert_eq!(new.data.as_slice().expect("present").as_bstr(), a_content);
4949 assert_eq!(new.driver_index, Some(0));
5050 assert_eq!(new.mode, EntryKind::BlobExecutable);
51− assert_eq!(new.id, hex_to_id("4c469b6c8c4486fdc9ded9d597d8f6816a455707"));
51+ let new_id = hex_to_id(
52+ "4c469b6c8c4486fdc9ded9d597d8f6816a455707",
53+ "061557fb6e67e1be5d41f8e83962699fce2a7d168ccfb2b5743d27ab06038da8",
54+ );
55+ assert_eq!(new.id, new_id);
5256 assert_eq!(new.rela_path, "a", "location is kept directly as provided");
5357
5458 let out = platform.prepare_diff()?;
@@ -70,7 +74,14 @@ fn resources_of_worktree_and_odb_and_check_link() -> crate::Result { · 15 unmodified lines
7074 2,
7175 3
7276 )),
73− format!("{}test a <tmp-path> 0000000000000000000000000000000000000000 100644 <tmp-path> 4c469b6c8c4486fdc9ded9d597d8f6816a455707 100755", if !cfg!(windows) { "GIT_DIFF_PATH_COUNTER=3 GIT_DIFF_PATH_TOTAL=3 GIT_DIR=. " } else { Default::default() }),
77+ format!(
78+ "{}test a <tmp-path> 0000000000000000000000000000000000000000 100644 <tmp-path> {new_id} 100755",
79+ if !cfg!(windows) {
80+ "GIT_DIFF_PATH_COUNTER=3 GIT_DIFF_PATH_TOTAL=3 GIT_DIR=. "
81+ } else {
82+ ""
83+ }
84+ ),
7485 "in this case, there is no rename-to field as last argument, it's based on the resource paths being different"
7586 );
7687
@@ -95,7 +106,7 @@ fn resources_of_worktree_and_odb_and_check_link() -> crate::Result { · 18 unmodified lines
95106 a_content,
96107 "despite the same content"
97108 );
98− assert_eq!(new.id, hex_to_id("4c469b6c8c4486fdc9ded9d597d8f6816a455707"));
109+ assert_eq!(new.id, new_id);
99110 assert_eq!(new.rela_path, "a");
100111
101112 let out = platform.prepare_diff()?;
@@ -117,7 +128,14 @@ fn resources_of_worktree_and_odb_and_check_link() -> crate::Result { · 15 unmodified lines
117128 0,
118129 1
119130 )),
120− format!("{}test a <tmp-path> 0000000000000000000000000000000000000000 100644 <tmp-path> 4c469b6c8c4486fdc9ded9d597d8f6816a455707 120000", if !cfg!(windows) { r#"GIT_DIFF_PATH_COUNTER=1 GIT_DIFF_PATH_TOTAL=1 GIT_DIR=. "# } else { Default::default() }),
131+ format!(
132+ "{}test a <tmp-path> 0000000000000000000000000000000000000000 100644 <tmp-path> {new_id} 120000",
133+ if !cfg!(windows) {
134+ r#"GIT_DIFF_PATH_COUNTER=1 GIT_DIFF_PATH_TOTAL=1 GIT_DIR=. "#
135+ } else {
136+ ""
137+ }
138+ ),
121139 "Also obvious that symlinks are definitely special, but it's what git does as well"
122140 );
123141
gix-diff/tests/diff/index.rs+18−15
@@ -328,21 +328,24 @@ fn renames_by_similarity_with_limit() -> crate::Result { · 327 unmodified lines
328328 assert_eq!(actual_entry_modes, [Mode::FILE, Mode::FILE, Mode::FILE, Mode::FILE]);
329329
330330 let actual_ids: Vec<_> = changes.iter().map(ChangeRef::id).collect();
331− let expected_ids = match crate::fixture_hash_kind() {
332− gix_hash::Kind::Sha1 => [
333− crate::hex_to_id("f00c965d8307308469e537302baa73048488f162"),
334− crate::hex_to_id("683cfcc0f47566c332aa45d81c5cc98acb4aab49"),
335− crate::hex_to_id("3bb459b831ea471b9cd1cbb7c6d54a74251a711b"),
336− crate::hex_to_id("0a805f8e02d72bd354c1f00607906de2e49e00d6"),
337− ],
338− gix_hash::Kind::Sha256 => [
339− crate::hex_to_id("300fc9db3fb50e3794eb4013cfe2c9f6c0fa1d8db7f9e3a4f6f0158b3b62cc69"),
340− crate::hex_to_id("b863f94555dd058a680cca6d4afa1bad30b5f9c36122c7089f853081aa1c5a28"),
341− crate::hex_to_id("19ebb6b2c2f3a64e6578013f680ec39330ce158af5977a1b17be0d551185fbab"),
342− crate::hex_to_id("6271a9ad76b692e75a96d260cf02c4cd89e1d2071256447ff50e8a8f443299b4"),
343− ],
344− _ => unreachable!("tests only support sha1 and sha256 fixtures"),
345− };
331+ let expected_ids = [
332+ crate::hex_to_id(
333+ "f00c965d8307308469e537302baa73048488f162",
334+ "300fc9db3fb50e3794eb4013cfe2c9f6c0fa1d8db7f9e3a4f6f0158b3b62cc69",
335+ ),
336+ crate::hex_to_id(
337+ "683cfcc0f47566c332aa45d81c5cc98acb4aab49",
338+ "b863f94555dd058a680cca6d4afa1bad30b5f9c36122c7089f853081aa1c5a28",
339+ ),
340+ crate::hex_to_id(
341+ "3bb459b831ea471b9cd1cbb7c6d54a74251a711b",
342+ "19ebb6b2c2f3a64e6578013f680ec39330ce158af5977a1b17be0d551185fbab",
343+ ),
344+ crate::hex_to_id(
345+ "0a805f8e02d72bd354c1f00607906de2e49e00d6",
346+ "6271a9ad76b692e75a96d260cf02c4cd89e1d2071256447ff50e8a8f443299b4",
347+ ),
348+ ];
346349 assert_eq!(actual_ids, expected_ids);
347350
348351 let out = out.expect("tracking enabled");
gix-diff/tests/diff/main.rs+7−13
@@ -1,8 +1,12 @@
11 use gix_testtools::Result;
22 use std::collections::HashMap;
33
4−fn hex_to_id(hex: &str) -> gix_hash::ObjectId {
5− gix_hash::ObjectId::from_hex(hex.as_bytes()).expect("valid hex id")
4+fn hex_to_id(hex_sha1: &str, hex_sha256: &str) -> gix_hash::ObjectId {
5+ match gix_testtools::hash_kind_from_env().unwrap_or_default() {
6+ gix_hash::Kind::Sha1 => gix_hash::ObjectId::from_hex(hex_sha1.as_bytes()).expect("40 bytes hex"),
7+ gix_hash::Kind::Sha256 => gix_hash::ObjectId::from_hex(hex_sha256.as_bytes()).expect("64 bytes hex"),
8+ _ => unimplemented!(),
9+ }
610 }
711
812 fn fixture_hash_kind() -> gix_hash::Kind {
@@ -121,16 +125,6 @@ fn assert_hash_agnostic_patch_eq(actual: &str, expected: &str) { · 112 unmodified lines
121125 pretty_assertions::assert_eq!(normalize_patch_snapshot(expected), normalize_patch_snapshot(actual));
122126 }
123127
124−macro_rules! assert_hash_agnostic_eq {
125− ($left:expr, $right:expr $(, $($arg:tt)+)?) => {{
126− pretty_assertions::assert_eq!(
127− crate::normalize_debug_snapshot(&($left)),
128− crate::normalize_debug_snapshot(&($right))
129− $(, $($arg)+)?
130− );
131− }};
132−}
133−
134128 mod blob;
135129 mod index;
136130 mod rewrites;
@@ -180,7 +174,7 @@ mod util { · 43 unmodified lines
180174 impl ObjectDb {
181175 /// Insert `data` and return its hash. That can be used to find it again.
182176 pub fn insert(&mut self, data: &str) -> Result<gix_hash::ObjectId, Error> {
183− let id = gix_object::compute_hash(gix_hash::Kind::Sha1, gix_object::Kind::Blob, data.as_bytes())?;
177+ let id = gix_object::compute_hash(super::fixture_hash_kind(), gix_object::Kind::Blob, data.as_bytes())?;
184178 self.data_by_id.insert(id, data.into());
185179 Ok(id)
186180 }
gix-diff/tests/diff/rewrites/mod.rs+10−8
@@ -1,3 +1,5 @@
1+use std::sync::LazyLock;
2+
13 use gix_diff::{
24 rewrites::tracker::ChangeKind,
35 tree::visit::{ChangeId, Relation},
@@ -37,12 +39,12 @@ impl gix_diff::rewrites::tracker::Change for Change { · 33 unmodified lines
3739 }
3840 }
3941
40−const NULL_ID: gix_hash::ObjectId = gix_hash::Kind::Sha1.null();
42+static NULL_ID: LazyLock<gix_hash::ObjectId> = LazyLock::new(|| crate::fixture_hash_kind().null());
4143
4244 impl Change {
4345 fn modification() -> Self {
4446 Change {
45− id: NULL_ID,
47+ id: *NULL_ID,
4648 kind: ChangeKind::Modification,
4749 mode: EntryKind::Blob.into(),
4850 relation: None,
@@ -50,7 +52,7 @@ impl Change { · 1 unmodified line
5052 }
5153 fn deletion() -> Self {
5254 Change {
53− id: NULL_ID,
55+ id: *NULL_ID,
5456 kind: ChangeKind::Deletion,
5557 mode: EntryKind::Blob.into(),
5658 relation: None,
@@ -58,7 +60,7 @@ impl Change { · 1 unmodified line
5860 }
5961 fn addition() -> Self {
6062 Change {
61− id: NULL_ID,
63+ id: *NULL_ID,
6264 kind: ChangeKind::Addition,
6365 mode: EntryKind::Blob.into(),
6466 relation: None,
@@ -67,7 +69,7 @@ impl Change { · 2 unmodified lines
6769
6870 fn addition_in_tree(id: ChangeId) -> Self {
6971 Change {
70− id: NULL_ID,
72+ id: *NULL_ID,
7173 kind: ChangeKind::Addition,
7274 mode: EntryKind::Blob.into(),
7375 relation: Some(Relation::ChildOfParent(id)),
@@ -76,7 +78,7 @@ impl Change { · 2 unmodified lines
7678
7779 fn deletion_in_tree(id: ChangeId) -> Self {
7880 Change {
79− id: NULL_ID,
81+ id: *NULL_ID,
8082 kind: ChangeKind::Deletion,
8183 mode: EntryKind::Blob.into(),
8284 relation: Some(Relation::ChildOfParent(id)),
@@ -85,7 +87,7 @@ impl Change { · 2 unmodified lines
8587
8688 fn tree_addition(id: ChangeId) -> Self {
8789 Change {
88− id: NULL_ID,
90+ id: *NULL_ID,
8991 kind: ChangeKind::Addition,
9092 mode: EntryKind::Tree.into(),
9193 relation: Some(Relation::Parent(id)),
@@ -94,7 +96,7 @@ impl Change { · 2 unmodified lines
9496
9597 fn tree_deletion(id: ChangeId) -> Self {
9698 Change {
97− id: NULL_ID,
99+ id: *NULL_ID,
98100 kind: ChangeKind::Deletion,
99101 mode: EntryKind::Tree.into(),
100102 relation: Some(Relation::Parent(id)),
gix-diff/tests/diff/rewrites/tracker.rs+220−89
@@ -50,7 +50,7 @@ fn rename_by_id() -> crate::Result { · 49 unmodified lines
5050 src.unwrap(),
5151 Source {
5252 entry_mode: EntryKind::Blob.into(),
53− id: NULL_ID,
53+ id: *NULL_ID,
5454 kind: SourceKind::Rename,
5555 location: "b".into(),
5656 change: &Change::deletion(),
@@ -151,7 +151,10 @@ fn copy_by_id() -> crate::Result { · 94 unmodified lines
151151 let out = util::assert_emit_with_objects(
152152 &mut track,
153153 |dst, src| {
154− let id = hex_to_id("2e65efe2a145dda7ee51d1741299f848e5bf752e");
154+ let id = hex_to_id(
155+ "2e65efe2a145dda7ee51d1741299f848e5bf752e",
156+ "eb337bcee2061c5313c9a1392116b6c76039e9e30d71467ae359b36277e17dc7",
157+ );
155158 let source_a = Source {
156159 entry_mode: EntryKind::Blob.into(),
157160 id,
@@ -220,8 +223,12 @@ fn copy_by_id_search_in_all_sources() -> crate::Result { · 62 unmodified lines
220223 ],
221224 )?;
222225
226+ let content_id = hex_to_id(
227+ "2e65efe2a145dda7ee51d1741299f848e5bf752e",
228+ "eb337bcee2061c5313c9a1392116b6c76039e9e30d71467ae359b36277e17dc7",
229+ );
230+
223231 let mut calls = 0;
224− let content_id = hex_to_id("2e65efe2a145dda7ee51d1741299f848e5bf752e");
225232 let out = util::assert_emit_with_objects_and_sources(
226233 &mut track,
227234 |dst, src| {
@@ -305,7 +312,10 @@ fn copy_by_50_percent_similarity() -> crate::Result { · 77 unmodified lines
305312 let out = util::assert_emit_with_objects(
306313 &mut track,
307314 |dst, src| {
308− let id = hex_to_id("78981922613b2afb6025042ff6bd878ac1994e85");
315+ let id = hex_to_id(
316+ "78981922613b2afb6025042ff6bd878ac1994e85",
317+ "f8625e43f9e04f24291f77cdbe4c71b3c2a3b0003f60419b3ed06a058d766c8b",
318+ );
309319 let source_a = Source {
310320 entry_mode: EntryKind::Blob.into(),
311321 id,
@@ -483,7 +493,10 @@ fn rename_by_50_percent_similarity() -> crate::Result { · 171 unmodified lines
483493 |dst, src| {
484494 match calls {
485495 0 => {
486− let id = hex_to_id("66a52ee7a1d803dc57859c3e95ac9dcdc87c0164");
496+ let id = hex_to_id(
497+ "66a52ee7a1d803dc57859c3e95ac9dcdc87c0164",
498+ "fdf2fd32de1d33ee5744979b40b07e0930a12c59dfbc5b3b6d34b807f944ba6e",
499+ );
487500 assert_eq!(
488501 src.unwrap(),
489502 Source {
@@ -517,16 +530,27 @@ fn rename_by_50_percent_similarity() -> crate::Result { · 27 unmodified lines
517530 },
518531 odb,
519532 );
520− assert_eq!(
521− out,
522− rewrites::Outcome {
533+
534+ // The rename tracker currently sorts by hash, hence the outcome is hash-dependent.
535+ let expected = match crate::fixture_hash_kind() {
536+ gix_hash::Kind::Sha1 => rewrites::Outcome {
523537 options: rewrites,
524538 num_similarity_checks: 1,
525539 ..Default::default()
526540 },
541+ gix_hash::Kind::Sha256 => rewrites::Outcome {
542+ options: rewrites,
543+ num_similarity_checks: 2,
544+ ..Default::default()
545+ },
546+ _ => todo!(),
547+ };
548+ assert_eq!(
549+ out, expected,
527550 "the first attempt already yields the one pair, so it doesn't participate anymore\
528− - we don't have best candidates yet, thus only one check"
551+ - we don't have best candidates yet, thus only one check"
529552 );
553+
530554 Ok(())
531555 }
532556
@@ -535,7 +559,7 @@ fn directories_without_relation_are_ignored() -> crate::Result { · 2 unmodified lines
535559 let mut track = util::new_tracker(Default::default());
536560 for mode in [EntryKind::Tree, EntryKind::Commit] {
537561 let tree_without_relation = Change {
538− id: NULL_ID,
562+ id: *NULL_ID,
539563 kind: ChangeKind::Deletion,
540564 mode: mode.into(),
541565 relation: None,
@@ -559,7 +583,10 @@ fn directory_renames_by_id_can_fail_gracefully() -> crate::Result { · 17 unmodified lines
559583 };
560584 let mut track = util::new_tracker(rename_by_similarity);
561585 let tree_dst_id = 1;
562− let tree_id = hex_to_id("bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
586+ let tree_id = hex_to_id(
587+ "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
588+ "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
589+ );
563590 assert!(track
564591 .try_push_change(
565592 Change {
@@ -573,7 +600,10 @@ fn directory_renames_by_id_can_fail_gracefully() -> crate::Result { · 7 unmodified lines
573600 .is_none());
574601
575602 let tree_src_id = 3;
576− let tree_id = hex_to_id("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
603+ let tree_id = hex_to_id(
604+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
605+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
606+ );
577607 assert!(track
578608 .try_push_change(
579609 Change {
@@ -598,45 +628,92 @@ fn directory_renames_by_id_can_fail_gracefully() -> crate::Result { · 18 unmodified lines
598628 ],
599629 )?;
600630
631+ // The rename tracker currently sorts by hash, hence the outcome is hash-dependent.
601632 let mut calls = 0;
602− let out = util::assert_emit_with_objects(
603− &mut track,
604− |dst, src| {
605− match calls {
606− 0..=2 => {
607− let src = src.unwrap();
608− let (expected_src, expected_dst) =
609− &[("d/a", "d-renamed/a"), ("d/c", "d-renamed/subdir/c"), ("a", "b")][calls];
610− assert_eq!(src.location, expected_src);
611− assert_eq!(dst.location, expected_dst);
612− }
613− 3 => {
614− assert_eq!(src.unwrap().location, "d");
615− assert_eq!(
616− dst.location, "d-renamed",
617− "it can now track modified and renamed directories"
618− );
633+ match crate::fixture_hash_kind() {
634+ gix_hash::Kind::Sha1 => {
635+ let out = util::assert_emit_with_objects(
636+ &mut track,
637+ |dst, src| {
638+ match calls {
639+ 0..=2 => {
640+ let src = src.unwrap();
641+ let (expected_src, expected_dst) =
642+ &[("d/a", "d-renamed/a"), ("d/c", "d-renamed/subdir/c"), ("a", "b")][calls];
643+ assert_eq!(src.location, expected_src);
644+ assert_eq!(dst.location, expected_dst);
645+ }
646+ 3 => {
647+ assert_eq!(src.unwrap().location, "d");
648+ assert_eq!(
649+ dst.location, "d-renamed",
650+ "it can now track modified and renamed directories"
651+ );
652+ }
653+ 4 => {
654+ assert_eq!(src, None);
655+ assert_eq!(dst.change.kind, ChangeKind::Deletion);
656+ assert_eq!(dst.location, "d/subdir/d");
657+ }
658+ _ => unreachable!("Should have expected emission call {calls}"),
659+ }
660+ calls += 1;
661+ std::ops::ControlFlow::Continue(())
662+ },
663+ &odb,
664+ );
665+ assert_eq!(
666+ out,
667+ rewrites::Outcome {
668+ options: rename_by_similarity,
669+ num_similarity_checks: 1,
670+ ..Default::default()
619671 }
620− 4 => {
621− assert_eq!(src, None);
622− assert_eq!(dst.change.kind, ChangeKind::Deletion);
623− assert_eq!(dst.location, "d/subdir/d");
672+ );
673+ }
674+ gix_hash::Kind::Sha256 => {
675+ let out = util::assert_emit_with_objects(
676+ &mut track,
677+ |dst, src| {
678+ match calls {
679+ 0..=2 => {
680+ let src = src.unwrap();
681+ let (expected_src, expected_dst) =
682+ &[("d/c", "d-renamed/subdir/c"), ("d/a", "d-renamed/a"), ("a", "b")][calls];
683+ assert_eq!(src.location, expected_src);
684+ assert_eq!(dst.location, expected_dst);
685+ }
686+ 3 => {
687+ assert_eq!(src.unwrap().location, "d");
688+ assert_eq!(
689+ dst.location, "d-renamed",
690+ "it can now track modified and renamed directories"
691+ );
692+ }
693+ 4 => {
694+ assert_eq!(src, None);
695+ assert_eq!(dst.change.kind, ChangeKind::Deletion);
696+ assert_eq!(dst.location, "d/subdir/d");
697+ }
698+ _ => unreachable!("Should have expected emission call {calls}"),
699+ }
700+ calls += 1;
701+ std::ops::ControlFlow::Continue(())
702+ },
703+ &odb,
704+ );
705+ assert_eq!(
706+ out,
707+ rewrites::Outcome {
708+ options: rename_by_similarity,
709+ num_similarity_checks: 2,
710+ ..Default::default()
624711 }
625− _ => unreachable!("Should have expected emission call {calls}"),
626− }
627− calls += 1;
628− std::ops::ControlFlow::Continue(())
629− },
630− &odb,
631− );
632− assert_eq!(
633− out,
634− rewrites::Outcome {
635− options: rename_by_similarity,
636− num_similarity_checks: 1,
637− ..Default::default()
712+ );
713+ assert_eq!(calls, 5, "Should not have too few calls");
638714 }
639− );
715+ _ => todo!(),
716+ }
640717 assert_eq!(calls, 5, "Should not have too few calls");
641718 Ok(())
642719 }
@@ -658,7 +735,10 @@ fn simple_directory_rename_by_id() -> crate::Result { · 15 unmodified lines
658735 assert!(track
659736 .try_push_change(Change::tree_deletion(tree_src_id), "d".into())
660737 .is_none());
661− let tree_id = hex_to_id("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
738+ let tree_id = hex_to_id(
739+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
740+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
741+ );
662742 assert!(
663743 track
664744 .try_push_change(
@@ -700,50 +780,101 @@ fn simple_directory_rename_by_id() -> crate::Result { · 35 unmodified lines
700780 (Change::addition(), "b", "firt\nsecond\n"),
701781 ],
702782 );
783+
703784 let mut calls = 0;
704− let out = util::assert_emit(&mut track, |dst, src| {
705− match calls {
706− 0 => {
707− let src = src.unwrap();
708− assert_eq!(src.location, "d");
709− assert_eq!(src.entry_mode.kind(), EntryKind::Tree);
710− assert_eq!(src.change.relation, Some(Relation::Parent(3)));
711− assert_eq!(dst.location, "d-renamed", "it found the renamed directory");
712− assert_eq!(dst.change.relation, Some(Relation::Parent(1)));
713− assert_eq!(dst.change.mode.kind(), EntryKind::Tree);
714− }
715− 1..=5 => {
716− let src = src.unwrap();
717− let (expected_src, expected_dst) = &[
718− ("d/a", "d-renamed/a"),
719− ("d/c", "d-renamed/c"),
720− ("d/b", "d-renamed/b"),
721− ("d/subdir", "d-renamed/subdir"),
722− ("d/subdir/d", "d-renamed/subdir/d"),
723− ][calls - 1];
724− assert_eq!(src.location, expected_src);
725− assert_eq!(dst.location, expected_dst);
726− }
727− 6 => {
728− assert_eq!(src, None);
729− assert_eq!(dst.location, "a");
730− }
731− 7 => {
732− assert_eq!(src, None);
733− assert_eq!(dst.location, "b");
734− }
735− _ => unreachable!("Should have expected emission call {calls}"),
785+ match crate::fixture_hash_kind() {
786+ gix_hash::Kind::Sha1 => {
787+ let out = util::assert_emit(&mut track, |dst, src| {
788+ match calls {
789+ 0 => {
790+ let src = src.unwrap();
791+ assert_eq!(src.location, "d");
792+ assert_eq!(src.entry_mode.kind(), EntryKind::Tree);
793+ assert_eq!(src.change.relation, Some(Relation::Parent(3)));
794+ assert_eq!(dst.location, "d-renamed", "it found the renamed directory");
795+ assert_eq!(dst.change.relation, Some(Relation::Parent(1)));
796+ assert_eq!(dst.change.mode.kind(), EntryKind::Tree);
797+ }
798+ 1..=5 => {
799+ let src = src.unwrap();
800+ let (expected_src, expected_dst) = &[
801+ ("d/a", "d-renamed/a"),
802+ ("d/c", "d-renamed/c"),
803+ ("d/b", "d-renamed/b"),
804+ ("d/subdir", "d-renamed/subdir"),
805+ ("d/subdir/d", "d-renamed/subdir/d"),
806+ ][calls - 1];
807+ assert_eq!(src.location, expected_src);
808+ assert_eq!(dst.location, expected_dst);
809+ }
810+ 6 => {
811+ assert_eq!(src, None);
812+ assert_eq!(dst.location, "a");
813+ }
814+ 7 => {
815+ assert_eq!(src, None);
816+ assert_eq!(dst.location, "b");
817+ }
818+ _ => unreachable!("Should have expected emission call {calls}"),
819+ }
820+ calls += 1;
821+ std::ops::ControlFlow::Continue(())
822+ });
823+ assert_eq!(
824+ out,
825+ rewrites::Outcome {
826+ options: renames_by_identity,
827+ ..Default::default()
828+ }
829+ );
736830 }
737− calls += 1;
738− std::ops::ControlFlow::Continue(())
739− });
740− assert_eq!(
741− out,
742− rewrites::Outcome {
743− options: renames_by_identity,
744− ..Default::default()
831+ gix_hash::Kind::Sha256 => {
832+ let out = util::assert_emit(&mut track, |dst, src| {
833+ match calls {
834+ 0 => {
835+ let src = src.unwrap();
836+ assert_eq!(src.location, "d");
837+ assert_eq!(src.entry_mode.kind(), EntryKind::Tree);
838+ assert_eq!(src.change.relation, Some(Relation::Parent(3)));
839+ assert_eq!(dst.location, "d-renamed", "it found the renamed directory");
840+ assert_eq!(dst.change.relation, Some(Relation::Parent(1)));
841+ assert_eq!(dst.change.mode.kind(), EntryKind::Tree);
842+ }
843+ 1..=5 => {
844+ let src = src.unwrap();
845+ let (expected_src, expected_dst) = &[
846+ ("d/subdir/d", "d-renamed/subdir/d"),
847+ ("d/b", "d-renamed/b"),
848+ ("d/subdir", "d-renamed/subdir"),
849+ ("d/c", "d-renamed/c"),
850+ ("d/a", "d-renamed/a"),
851+ ][calls - 1];
852+ assert_eq!(src.location, expected_src);
853+ assert_eq!(dst.location, expected_dst);
854+ }
855+ 6 => {
856+ assert_eq!(src, None);
857+ assert_eq!(dst.location, "a");
858+ }
859+ 7 => {
860+ assert_eq!(src, None);
861+ assert_eq!(dst.location, "b");
862+ }
863+ _ => unreachable!("Should have expected emission call {calls}"),
864+ }
865+ calls += 1;
866+ std::ops::ControlFlow::Continue(())
867+ });
868+ assert_eq!(
869+ out,
870+ rewrites::Outcome {
871+ options: renames_by_identity,
872+ ..Default::default()
873+ }
874+ );
745875 }
746− );
876+ _ => todo!(),
877+ }
747878 assert_eq!(calls, 8, "Should not have too few calls");
748879 Ok(())
749880 }
gix-diff/tests/diff/tree.rs+170−105
@@ -159,34 +159,37 @@ mod changes { · 158 unmodified lines
159159 fn many_different_states() -> crate::Result {
160160 let db = db(None)?;
161161 let all_commits = all_commits(&db);
162− assert_hash_agnostic_eq!(
162+ pretty_assertions::assert_eq!(
163163 diff_with_previous_commit_from(&db, &all_commits["f added"])?,
164164 vec![Addition {
165165 entry_mode: EntryKind::Blob.into(),
166− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
166+ oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"),
167167 path: "f".into(),
168168 relation: None
169169 }],
170170 ":000000 100644 0000000000000000000000000000000000000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 A f"
171171 );
172172
173− assert_hash_agnostic_eq!(
173+ pretty_assertions::assert_eq!(
174174 diff_with_previous_commit_from(&db, &all_commits["f modified"])?,
175175 vec![Modification {
176176 previous_entry_mode: EntryKind::Blob.into(),
177− previous_oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
177+ previous_oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"),
178178 entry_mode: EntryKind::Blob.into(),
179− oid: hex_to_id("28ce6a8b26aa170e1de65536fe8abe1832bd3242"),
179+ oid: hex_to_id("28ce6a8b26aa170e1de65536fe8abe1832bd3242", "6ca8d4e3bc5df874055e542d18505b5a5efa0fb7d65776efedc13781073ed0f1"),
180180 path: "f".into()
181181 }],
182182 ":100644 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 28ce6a8b26aa170e1de65536fe8abe1832bd3242 M f"
183183 );
184184
185− assert_hash_agnostic_eq!(
185+ pretty_assertions::assert_eq!(
186186 diff_with_previous_commit_from(&db, &all_commits["f deleted"])?,
187187 vec![Deletion {
188188 entry_mode: EntryKind::Blob.into(),
189− oid: hex_to_id("28ce6a8b26aa170e1de65536fe8abe1832bd3242"),
189+ oid: hex_to_id(
190+ "28ce6a8b26aa170e1de65536fe8abe1832bd3242",
191+ "6ca8d4e3bc5df874055e542d18505b5a5efa0fb7d65776efedc13781073ed0f1"
192+ ),
190193 path: "f".into(),
191194 relation: None
192195 }],
@@ -194,24 +197,24 @@ mod changes { · 1 unmodified line
194197 "
195198 );
196199
197− assert_hash_agnostic_eq!(
200+ pretty_assertions::assert_eq!(
198201 diff_with_previous_commit_from(&db, &all_commits["f mode modified to dir f/"])?,
199202 vec![
200203 Deletion {
201204 entry_mode: EntryKind::Blob.into(),
202− oid: hex_to_id("28ce6a8b26aa170e1de65536fe8abe1832bd3242"),
205+ oid: hex_to_id("28ce6a8b26aa170e1de65536fe8abe1832bd3242", "6ca8d4e3bc5df874055e542d18505b5a5efa0fb7d65776efedc13781073ed0f1"),
203206 path: "f".into(),
204207 relation: None
205208 },
206209 Addition {
207210 entry_mode: EntryKind::Tree.into(),
208− oid: hex_to_id("10f2f4b82222d2b5c31985130979a91fd87410f7"),
211+ oid: hex_to_id("10f2f4b82222d2b5c31985130979a91fd87410f7", "9e220e584599b9cff376b638fa71675280f4582a87138b6be425258dbb85f94c"),
209212 path: "f".into(),
210213 relation: Some(Relation::Parent(1)),
211214 },
212215 Addition {
213216 entry_mode: EntryKind::Blob.into(),
214− oid: hex_to_id("28ce6a8b26aa170e1de65536fe8abe1832bd3242"),
217+ oid: hex_to_id("28ce6a8b26aa170e1de65536fe8abe1832bd3242", "6ca8d4e3bc5df874055e542d18505b5a5efa0fb7d65776efedc13781073ed0f1"),
215218 path: "f/f".into(),
216219 relation: Some(Relation::ChildOfParent(1)),
217220 }
@@ -220,18 +223,18 @@ mod changes { · 2 unmodified lines
220223 :000000 100644 0000000000000000000000000000000000000000 28ce6a8b26aa170e1de65536fe8abe1832bd3242 A f/f"
221224 );
222225
223− assert_hash_agnostic_eq!(
226+ pretty_assertions::assert_eq!(
224227 diff_with_previous_commit_from(&db, &all_commits["a renamed to b"])?,
225228 vec![
226229 Deletion {
227230 entry_mode: EntryKind::Blob.into(),
228− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
231+ oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"),
229232 path: "a".into(),
230233 relation: None
231234 },
232235 Addition {
233236 entry_mode: EntryKind::Blob.into(),
234− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
237+ oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"),
235238 path: "b".into(),
236239 relation: None
237240 }
@@ -242,43 +245,49 @@ mod changes { · 4 unmodified lines
242245
243246 );
244247
245− assert_hash_agnostic_eq!(
248+ pretty_assertions::assert_eq!(
246249 diff_with_previous_commit_from(&db, &all_commits["f/f modified"])?,
247250 vec![
248251 Modification {
249252 previous_entry_mode: EntryKind::Tree.into(),
250− previous_oid: hex_to_id("10f2f4b82222d2b5c31985130979a91fd87410f7"),
253+ previous_oid: hex_to_id("10f2f4b82222d2b5c31985130979a91fd87410f7", "9e220e584599b9cff376b638fa71675280f4582a87138b6be425258dbb85f94c"),
251254 entry_mode: EntryKind::Tree.into(),
252− oid: hex_to_id("ebbe0b3000afdfd1aed15000094b59a2800328eb"),
255+ oid: hex_to_id("ebbe0b3000afdfd1aed15000094b59a2800328eb", "ca3ee6fe1455fc077ae53f0fe7af54153feb35d52a892b1377e9c0b6828428d4"),
253256 path: "f".into()
254257 },
255258 Modification {
256259 previous_entry_mode: EntryKind::Blob.into(),
257− previous_oid: hex_to_id("28ce6a8b26aa170e1de65536fe8abe1832bd3242"),
260+ previous_oid: hex_to_id("28ce6a8b26aa170e1de65536fe8abe1832bd3242", "6ca8d4e3bc5df874055e542d18505b5a5efa0fb7d65776efedc13781073ed0f1"),
258261 entry_mode: EntryKind::Blob.into(),
259− oid: hex_to_id("13c2aca72ab576cb5f22dc8e7f8ba8ddab553a8a"),
262+ oid: hex_to_id("13c2aca72ab576cb5f22dc8e7f8ba8ddab553a8a", "ab879bd65609705434bab6bc157306769fd1053c6d86d82c89e76df9bee62809"),
260263 path: "f/f".into()
261264 },
262265 ],
263266 ":100644 100644 28ce6a8b26aa170e1de65536fe8abe1832bd3242 13c2aca72ab576cb5f22dc8e7f8ba8ddab553a8a M f/f"
264267 );
265268
266− let tree_with_link_id = hex_to_id("7e26dba59b6336f87d1d4ae3505a2da302b91c76");
267− let link_entry_oid = hex_to_id("2e65efe2a145dda7ee51d1741299f848e5bf752e");
269+ let tree_with_link_id = hex_to_id(
270+ "7e26dba59b6336f87d1d4ae3505a2da302b91c76",
271+ "825cbacedb89cffe4fd6532846f376ab9cb8bc9e5cb399620d3592b714c2e95f",
272+ );
273+ let link_entry_oid = hex_to_id(
274+ "2e65efe2a145dda7ee51d1741299f848e5bf752e",
275+ "eb337bcee2061c5313c9a1392116b6c76039e9e30d71467ae359b36277e17dc7",
276+ );
268277 let link_entry_mode = EntryKind::Link;
269− assert_hash_agnostic_eq!(
278+ pretty_assertions::assert_eq!(
270279 diff_with_previous_commit_from(&db, &all_commits["f/f mode changed to link"])?,
271280 vec![
272281 Modification {
273282 previous_entry_mode: EntryKind::Tree.into(),
274− previous_oid: hex_to_id("849bd76db90b65ebbd2e6d3970ca70c96ee5592c"),
283+ previous_oid: hex_to_id("849bd76db90b65ebbd2e6d3970ca70c96ee5592c", "003781d2cca9a680f5ccfe0963614bb813dea1654968713b48a6a27490c3771e"),
275284 entry_mode: EntryKind::Tree.into(),
276285 oid: tree_with_link_id,
277286 path: "f".into()
278287 },
279288 Modification {
280289 previous_entry_mode: EntryKind::Blob.into(),
281− previous_oid: hex_to_id("13c2aca72ab576cb5f22dc8e7f8ba8ddab553a8a"),
290+ previous_oid: hex_to_id("13c2aca72ab576cb5f22dc8e7f8ba8ddab553a8a", "ab879bd65609705434bab6bc157306769fd1053c6d86d82c89e76df9bee62809"),
282291 entry_mode: link_entry_mode.into(),
283292 oid: link_entry_oid,
284293 path: "f/f".into()
@@ -287,12 +296,12 @@ mod changes { · 2 unmodified lines
287296 ":100644 120000 13c2aca72ab576cb5f22dc8e7f8ba8ddab553a8a 2e65efe2a145dda7ee51d1741299f848e5bf752e T f/f"
288297 );
289298
290− assert_hash_agnostic_eq!(
299+ pretty_assertions::assert_eq!(
291300 diff_with_previous_commit_from(&db, &all_commits["f/ changed into file f"])?,
292301 vec![
293302 Addition {
294303 entry_mode: EntryKind::Blob.into(),
295− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
304+ oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"),
296305 path: "f".into(),
297306 relation: None
298307 },
@@ -304,13 +313,13 @@ mod changes { · 5 unmodified lines
304313 },
305314 Deletion {
306315 entry_mode: EntryKind::Blob.into(),
307− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
316+ oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"),
308317 path: "f/a".into(),
309318 relation: Some(Relation::ChildOfParent(1))
310319 },
311320 Deletion {
312321 entry_mode: EntryKind::Blob.into(),
313− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
322+ oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"),
314323 path: "f/b".into(),
315324 relation: Some(Relation::ChildOfParent(1))
316325 },
@@ -326,42 +335,46 @@ mod changes { · 9 unmodified lines
326335 :100644 000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0000000000000000000000000000000000000000 D f/b
327336 :120000 000000 2e65efe2a145dda7ee51d1741299f848e5bf752e 0000000000000000000000000000000000000000 D f/f"
328337 );
329− assert_hash_agnostic_eq!(
338+ pretty_assertions::assert_eq!(
330339 diff_with_previous_commit_from(&db, &all_commits["delete d/"])?,
331340 vec![
332341 Deletion {
333342 entry_mode: EntryKind::Tree.into(),
334− oid: hex_to_id("3d5a503f4062d198b443db5065ca727f8354e7df"),
343+ oid: hex_to_id("3d5a503f4062d198b443db5065ca727f8354e7df", "1f5422fc234c61cf503a86521bcafcb86cc48653c5d80d4e93a6cc677e345b40"),
335344 path: "d".into(),
336345 relation: Some(Relation::Parent(1))
337346 },
338347 Deletion {
339348 entry_mode: EntryKind::Blob.into(),
340− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
349+ oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"),
341350 path: "d/f".into(),
342351 relation: Some(Relation::ChildOfParent(1))
343352 },
344353 ],
345354 ":100644 000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0000000000000000000000000000000000000000 D d/f"
346355 );
347− assert_hash_agnostic_eq!(
356+ let empty_blob_id = hex_to_id(
357+ "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
358+ "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813",
359+ );
360+ pretty_assertions::assert_eq!(
348361 diff_with_previous_commit_from(&db, &all_commits["add /c /d /e"])?,
349362 vec![
350363 Addition {
351364 entry_mode: EntryKind::Blob.into(),
352− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
365+ oid: empty_blob_id,
353366 path: "c".into(),
354367 relation: None,
355368 },
356369 Addition {
357370 entry_mode: EntryKind::Blob.into(),
358− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
371+ oid: empty_blob_id,
359372 path: "d".into(),
360373 relation: None,
361374 },
362375 Addition {
363376 entry_mode: EntryKind::Blob.into(),
364− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
377+ oid: empty_blob_id,
365378 path: "e".into(),
366379 relation: None,
367380 },
@@ -370,42 +383,42 @@ mod changes { · 2 unmodified lines
370383 :000000 100644 0000000000000000000000000000000000000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 A d
371384 :000000 100644 0000000000000000000000000000000000000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 A e"
372385 );
373− assert_hash_agnostic_eq!(
386+ pretty_assertions::assert_eq!(
374387 diff_with_previous_commit_from(&db, &all_commits["add g/a"])?,
375388 vec![
376389 Addition {
377390 entry_mode: EntryKind::Tree.into(),
378− oid: hex_to_id("496d6428b9cf92981dc9495211e6e1120fb6f2ba"),
391+ oid: hex_to_id("496d6428b9cf92981dc9495211e6e1120fb6f2ba", "5f6f307bcc469c02acba4f7da42d8d4defdda8209777fe732956f1e2fa0db3ff"),
379392 path: "g".into(),
380393 relation: Some(Relation::Parent(1))
381394 },
382395 Addition {
383396 entry_mode: EntryKind::Blob.into(),
384− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
397+ oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"),
385398 path: "g/a".into(),
386399 relation: Some(Relation::ChildOfParent(1))
387400 },
388401 ],
389402 ":000000 100644 0000000000000000000000000000000000000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 A g/a"
390403 );
391− assert_hash_agnostic_eq!(
404+ pretty_assertions::assert_eq!(
392405 diff_with_previous_commit_from(&db, &all_commits["remove /c /d /e"])?,
393406 vec![
394407 Deletion {
395408 entry_mode: EntryKind::Blob.into(),
396− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
409+ oid: empty_blob_id,
397410 path: "c".into(),
398411 relation: None
399412 },
400413 Deletion {
401414 entry_mode: EntryKind::Blob.into(),
402− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
415+ oid: empty_blob_id,
403416 path: "d".into(),
404417 relation: None
405418 },
406419 Deletion {
407420 entry_mode: EntryKind::Blob.into(),
408− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
421+ oid: empty_blob_id,
409422 path: "e".into(),
410423 relation: None
411424 },
@@ -414,18 +427,18 @@ mod changes { · 2 unmodified lines
414427 :100644 000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0000000000000000000000000000000000000000 D d
415428 :100644 000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0000000000000000000000000000000000000000 D e"
416429 );
417− assert_hash_agnostic_eq!(
430+ pretty_assertions::assert_eq!(
418431 diff_with_previous_commit_from(&db, &all_commits["rm /f, add /ff"])?,
419432 vec![
420433 Deletion {
421434 entry_mode: EntryKind::Blob.into(),
422− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
435+ oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"),
423436 path: "f".into(),
424437 relation: None
425438 },
426439 Addition {
427440 entry_mode: EntryKind::Blob.into(),
428− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
441+ oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"),
429442 path: "ff".into(),
430443 relation: None
431444 },
@@ -433,25 +446,25 @@ mod changes { · 1 unmodified line
433446 ":100644 000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0000000000000000000000000000000000000000 D f
434447 :000000 100644 0000000000000000000000000000000000000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 A ff"
435448 );
436− assert_hash_agnostic_eq!(
449+ pretty_assertions::assert_eq!(
437450 diff_with_previous_commit_from(&db, &all_commits["rm g/a, add g/aa"])?,
438451 vec![
439452 Modification {
440453 previous_entry_mode: EntryKind::Tree.into(),
441− previous_oid: hex_to_id("496d6428b9cf92981dc9495211e6e1120fb6f2ba"),
454+ previous_oid: hex_to_id("496d6428b9cf92981dc9495211e6e1120fb6f2ba", "5f6f307bcc469c02acba4f7da42d8d4defdda8209777fe732956f1e2fa0db3ff"),
442455 entry_mode: EntryKind::Tree.into(),
443− oid: hex_to_id("6e5931346904b020301f74f581142826eacc4678"),
456+ oid: hex_to_id("6e5931346904b020301f74f581142826eacc4678", "c56aa83b78552302a7ab7c6377d8a54573a3845e10242df3eae849394ab91b53"),
444457 path: "g".into()
445458 },
446459 Deletion {
447460 entry_mode: EntryKind::Blob.into(),
448− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
461+ oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"),
449462 path: "g/a".into(),
450463 relation: None
451464 },
452465 Addition {
453466 entry_mode: EntryKind::Blob.into(),
454− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
467+ oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"),
455468 path: "g/aa".into(),
456469 relation: None
457470 },
@@ -459,18 +472,18 @@ mod changes { · 1 unmodified line
459472 ":100644 000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0000000000000000000000000000000000000000 D g/a
460473 :000000 100644 0000000000000000000000000000000000000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 A g/aa"
461474 );
462− assert_hash_agnostic_eq!(
475+ pretty_assertions::assert_eq!(
463476 diff_with_previous_commit_from(&db, &all_commits["rm /ff, add /f"])?,
464477 vec![
465478 Addition {
466479 entry_mode: EntryKind::Blob.into(),
467− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
480+ oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"),
468481 path: "f".into(),
469482 relation: None,
470483 },
471484 Deletion {
472485 entry_mode: EntryKind::Blob.into(),
473− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
486+ oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"),
474487 path: "ff".into(),
475488 relation: None,
476489 },
@@ -478,25 +491,25 @@ mod changes { · 1 unmodified line
478491 ":100644 000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0000000000000000000000000000000000000000 D f
479492 :000000 100644 0000000000000000000000000000000000000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 A ff"
480493 );
481− assert_hash_agnostic_eq!(
494+ pretty_assertions::assert_eq!(
482495 diff_with_previous_commit_from(&db, &all_commits["rm g/aa, add g/a"])?,
483496 vec![
484497 Modification {
485498 previous_entry_mode: EntryKind::Tree.into(),
486− previous_oid: hex_to_id("6e5931346904b020301f74f581142826eacc4678"),
499+ previous_oid: hex_to_id("6e5931346904b020301f74f581142826eacc4678", "c56aa83b78552302a7ab7c6377d8a54573a3845e10242df3eae849394ab91b53"),
487500 entry_mode: EntryKind::Tree.into(),
488− oid: hex_to_id("496d6428b9cf92981dc9495211e6e1120fb6f2ba"),
501+ oid: hex_to_id("496d6428b9cf92981dc9495211e6e1120fb6f2ba", "5f6f307bcc469c02acba4f7da42d8d4defdda8209777fe732956f1e2fa0db3ff"),
489502 path: "g".into()
490503 },
491504 Addition {
492505 entry_mode: EntryKind::Blob.into(),
493− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
506+ oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"),
494507 path: "g/a".into(),
495508 relation: None,
496509 },
497510 Deletion {
498511 entry_mode: EntryKind::Blob.into(),
499− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
512+ oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"),
500513 path: "g/aa".into(),
501514 relation: None,
502515 },
@@ -512,39 +525,39 @@ mod changes { · 9 unmodified lines
512525 let db = db(["a"].iter().copied())?;
513526 let all_commits = all_commits(&db);
514527
515− assert_hash_agnostic_eq!(
528+ pretty_assertions::assert_eq!(
516529 diff_with_previous_commit_from(&db, &all_commits["f added"])?,
517530 vec![
518531 Addition {
519532 entry_mode: EntryKind::Tree.into(),
520− oid: hex_to_id("3d5a503f4062d198b443db5065ca727f8354e7df"),
533+ oid: hex_to_id("3d5a503f4062d198b443db5065ca727f8354e7df", "1f5422fc234c61cf503a86521bcafcb86cc48653c5d80d4e93a6cc677e345b40"),
521534 path: "a".into(),
522535 relation: Some(Relation::Parent(1)),
523536 },
524537 Addition {
525538 entry_mode: EntryKind::Blob.into(),
526− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
539+ oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"),
527540 path: "a/f".into(),
528541 relation: Some(Relation::ChildOfParent(1)),
529542 }
530543 ],
531544 ":000000 100644 0000000000000000000000000000000000000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 A a/f"
532545 );
533− assert_hash_agnostic_eq!(
546+ pretty_assertions::assert_eq!(
534547 diff_with_previous_commit_from(&db, &all_commits["f modified"])?,
535548 vec![
536549 Modification {
537550 previous_entry_mode: EntryKind::Tree.into(),
538− previous_oid: hex_to_id("3d5a503f4062d198b443db5065ca727f8354e7df"),
551+ previous_oid: hex_to_id("3d5a503f4062d198b443db5065ca727f8354e7df", "1f5422fc234c61cf503a86521bcafcb86cc48653c5d80d4e93a6cc677e345b40"),
539552 entry_mode: EntryKind::Tree.into(),
540− oid: hex_to_id("10f2f4b82222d2b5c31985130979a91fd87410f7"),
553+ oid: hex_to_id("10f2f4b82222d2b5c31985130979a91fd87410f7", "9e220e584599b9cff376b638fa71675280f4582a87138b6be425258dbb85f94c"),
541554 path: "a".into()
542555 },
543556 Modification {
544557 previous_entry_mode: EntryKind::Blob.into(),
545− previous_oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
558+ previous_oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"),
546559 entry_mode: EntryKind::Blob.into(),
547− oid: hex_to_id("28ce6a8b26aa170e1de65536fe8abe1832bd3242"),
560+ oid: hex_to_id("28ce6a8b26aa170e1de65536fe8abe1832bd3242", "6ca8d4e3bc5df874055e542d18505b5a5efa0fb7d65776efedc13781073ed0f1"),
548561 path: "a/f".into()
549562 }
550563 ],
@@ -567,47 +580,57 @@ mod changes { · 16 unmodified lines
567580
568581 let last_commit = all_commits["rm g/aa, add g/a"];
569582 let first_commit = all_commits["f added"];
570− assert_hash_agnostic_eq!(
583+ let empty_blob_id = hex_to_id(
584+ "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
585+ "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813",
586+ );
587+ pretty_assertions::assert_eq!(
571588 diff_commits(&db, first_commit.to_owned(), &last_commit, None)?,
572589 vec![
573590 Addition {
574591 entry_mode: EntryKind::Blob.into(),
575− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
592+ oid: empty_blob_id,
576593 path: "".into(),
577594 relation: None
578595 },
579596 Addition {
580597 entry_mode: EntryKind::Tree.into(),
581− oid: hex_to_id("496d6428b9cf92981dc9495211e6e1120fb6f2ba"),
598+ oid: hex_to_id(
599+ "496d6428b9cf92981dc9495211e6e1120fb6f2ba",
600+ "5f6f307bcc469c02acba4f7da42d8d4defdda8209777fe732956f1e2fa0db3ff"
601+ ),
582602 path: "".into(),
583603 relation: Some(Relation::Parent(1))
584604 },
585605 Addition {
586606 entry_mode: EntryKind::Blob.into(),
587− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
607+ oid: empty_blob_id,
588608 path: "".into(),
589609 relation: Some(Relation::ChildOfParent(1))
590610 }
591611 ]
592612 );
593− assert_hash_agnostic_eq!(
613+ pretty_assertions::assert_eq!(
594614 diff_commits(&db, last_commit.to_owned(), &first_commit, Location::FileName.into())?,
595615 vec![
596616 Deletion {
597617 entry_mode: EntryKind::Blob.into(),
598− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
618+ oid: empty_blob_id,
599619 path: "b".into(),
600620 relation: None
601621 },
602622 Deletion {
603623 entry_mode: EntryKind::Tree.into(),
604− oid: hex_to_id("496d6428b9cf92981dc9495211e6e1120fb6f2ba"),
624+ oid: hex_to_id(
625+ "496d6428b9cf92981dc9495211e6e1120fb6f2ba",
626+ "5f6f307bcc469c02acba4f7da42d8d4defdda8209777fe732956f1e2fa0db3ff"
627+ ),
605628 path: "g".into(),
606629 relation: Some(Relation::Parent(1))
607630 },
608631 Deletion {
609632 entry_mode: EntryKind::Blob.into(),
610− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
633+ oid: empty_blob_id,
611634 path: "a".into(),
612635 relation: Some(Relation::ChildOfParent(1))
613636 }
@@ -620,55 +643,65 @@ mod changes { · 6 unmodified lines
620643 fn maximal_difference_nested() -> crate::Result {
621644 let db = db(["a"].iter().copied())?;
622645 let all_commits = all_commits(&db);
646+ let empty_blob_id = hex_to_id(
647+ "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
648+ "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813",
649+ );
623650
624− assert_hash_agnostic_eq!(
651+ pretty_assertions::assert_eq!(
625652 diff_commits(&db, None::<ObjectId>, &all_commits["add g/a"], Some(Location::Path))?,
626653 vec![
627654 Addition {
628655 entry_mode: EntryKind::Tree.into(),
629− oid: hex_to_id("0df4d0ed769eacd0a231e7512fca25d3cabdeca4"),
656+ oid: hex_to_id(
657+ "0df4d0ed769eacd0a231e7512fca25d3cabdeca4",
658+ "dac24a12e6d43c6ad271e7ea4f021093dac44f15f99317b2e0d54753b4f09099"
659+ ),
630660 path: "a".into(),
631661 relation: Some(Relation::Parent(1)),
632662 },
633663 Addition {
634664 entry_mode: EntryKind::Blob.into(),
635− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
665+ oid: empty_blob_id,
636666 path: "a/b".into(),
637667 relation: Some(Relation::ChildOfParent(1)),
638668 },
639669 Addition {
640670 entry_mode: EntryKind::Blob.into(),
641− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
671+ oid: empty_blob_id,
642672 path: "a/c".into(),
643673 relation: Some(Relation::ChildOfParent(1)),
644674 },
645675 Addition {
646676 entry_mode: EntryKind::Blob.into(),
647− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
677+ oid: empty_blob_id,
648678 path: "a/d".into(),
649679 relation: Some(Relation::ChildOfParent(1)),
650680 },
651681 Addition {
652682 entry_mode: EntryKind::Blob.into(),
653− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
683+ oid: empty_blob_id,
654684 path: "a/e".into(),
655685 relation: Some(Relation::ChildOfParent(1)),
656686 },
657687 Addition {
658688 entry_mode: EntryKind::Blob.into(),
659− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
689+ oid: empty_blob_id,
660690 path: "a/f".into(),
661691 relation: Some(Relation::ChildOfParent(1)),
662692 },
663693 Addition {
664694 entry_mode: EntryKind::Tree.into(),
665− oid: hex_to_id("496d6428b9cf92981dc9495211e6e1120fb6f2ba"),
695+ oid: hex_to_id(
696+ "496d6428b9cf92981dc9495211e6e1120fb6f2ba",
697+ "5f6f307bcc469c02acba4f7da42d8d4defdda8209777fe732956f1e2fa0db3ff"
698+ ),
666699 path: "a/g".into(),
667700 relation: Some(Relation::ChildOfParent(1)),
668701 },
669702 Addition {
670703 entry_mode: EntryKind::Blob.into(),
671− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
704+ oid: empty_blob_id,
672705 path: "a/g/a".into(),
673706 relation: Some(Relation::ChildOfParent(1)),
674707 }
@@ -681,67 +714,83 @@ mod changes { · 6 unmodified lines
681714 fn directory_rename() -> crate::Result {
682715 let db = db(None)?;
683716 let all_commits = all_commits(&db);
717+ let empty_blob_id = hex_to_id(
718+ "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
719+ "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813",
720+ );
684721
685− assert_hash_agnostic_eq!(
722+ pretty_assertions::assert_eq!(
686723 diff_with_previous_commit_from(&db, &all_commits["rename git-sec to gix-sec"])?,
687724 vec![
688725 Deletion {
689726 entry_mode: EntryKind::Tree.into(),
690− oid: hex_to_id("d8c30fb72173778ed57fac5813c5e37038a8746c"),
727+ oid: hex_to_id(
728+ "d8c30fb72173778ed57fac5813c5e37038a8746c",
729+ "52a70042eff6fbeed1d6c8c0ed2f9cc775a19cc51b395429c4210bc5091520ad"
730+ ),
691731 path: "git-sec".into(),
692732 relation: Some(Relation::Parent(1)),
693733 },
694734 Addition {
695735 entry_mode: EntryKind::Tree.into(),
696− oid: hex_to_id("d8c30fb72173778ed57fac5813c5e37038a8746c"),
736+ oid: hex_to_id(
737+ "d8c30fb72173778ed57fac5813c5e37038a8746c",
738+ "52a70042eff6fbeed1d6c8c0ed2f9cc775a19cc51b395429c4210bc5091520ad"
739+ ),
697740 path: "gix-sec".into(),
698741 relation: Some(Relation::Parent(2)),
699742 },
700743 Deletion {
701744 entry_mode: EntryKind::Blob.into(),
702− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
745+ oid: empty_blob_id,
703746 path: "git-sec/2".into(),
704747 relation: Some(Relation::ChildOfParent(1)),
705748 },
706749 Deletion {
707750 entry_mode: EntryKind::Blob.into(),
708− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
751+ oid: empty_blob_id,
709752 path: "git-sec/7".into(),
710753 relation: Some(Relation::ChildOfParent(1)),
711754 },
712755 Deletion {
713756 entry_mode: EntryKind::Tree.into(),
714− oid: hex_to_id("fd7938a0c18f993c89eda3f40a6d06fa6785833c"),
757+ oid: hex_to_id(
758+ "fd7938a0c18f993c89eda3f40a6d06fa6785833c",
759+ "5b2e08d098c63c2f31c8937c810f77ff005c48833701e0854f690188f1887aae"
760+ ),
715761 path: "git-sec/subdir".into(),
716762 relation: Some(Relation::ChildOfParent(1)),
717763 },
718764 Addition {
719765 entry_mode: EntryKind::Blob.into(),
720− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
766+ oid: empty_blob_id,
721767 path: "gix-sec/2".into(),
722768 relation: Some(Relation::ChildOfParent(2)),
723769 },
724770 Addition {
725771 entry_mode: EntryKind::Blob.into(),
726− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
772+ oid: empty_blob_id,
727773 path: "gix-sec/7".into(),
728774 relation: Some(Relation::ChildOfParent(2)),
729775 },
730776 Addition {
731777 entry_mode: EntryKind::Tree.into(),
732− oid: hex_to_id("fd7938a0c18f993c89eda3f40a6d06fa6785833c"),
778+ oid: hex_to_id(
779+ "fd7938a0c18f993c89eda3f40a6d06fa6785833c",
780+ "5b2e08d098c63c2f31c8937c810f77ff005c48833701e0854f690188f1887aae"
781+ ),
733782 path: "gix-sec/subdir".into(),
734783 relation: Some(Relation::ChildOfParent(2)),
735784 },
736785 Deletion {
737786 entry_mode: EntryKind::Blob.into(),
738− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
787+ oid: empty_blob_id,
739788 path: "git-sec/subdir/6".into(),
740789 relation: Some(Relation::ChildOfParent(1)),
741790 },
742791 Addition {
743792 entry_mode: EntryKind::Blob.into(),
744− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
793+ oid: empty_blob_id,
745794 path: "gix-sec/subdir/6".into(),
746795 relation: Some(Relation::ChildOfParent(2)),
747796 }
@@ -754,67 +803,83 @@ mod changes { · 6 unmodified lines
754803 fn reverse_directory_rename() -> crate::Result {
755804 let db = db(None)?;
756805 let all_commits = all_commits(&db);
806+ let empty_blob_id = hex_to_id(
807+ "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
808+ "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813",
809+ );
757810
758− assert_hash_agnostic_eq!(
811+ pretty_assertions::assert_eq!(
759812 diff_with_previous_commit_from(&db, &all_commits["rename gix-sec to git-sec"])?,
760813 vec![
761814 Addition {
762815 entry_mode: EntryKind::Tree.into(),
763− oid: hex_to_id("d8c30fb72173778ed57fac5813c5e37038a8746c"),
816+ oid: hex_to_id(
817+ "d8c30fb72173778ed57fac5813c5e37038a8746c",
818+ "52a70042eff6fbeed1d6c8c0ed2f9cc775a19cc51b395429c4210bc5091520ad"
819+ ),
764820 path: "git-sec".into(),
765821 relation: Some(Relation::Parent(1)),
766822 },
767823 Deletion {
768824 entry_mode: EntryKind::Tree.into(),
769− oid: hex_to_id("d8c30fb72173778ed57fac5813c5e37038a8746c"),
825+ oid: hex_to_id(
826+ "d8c30fb72173778ed57fac5813c5e37038a8746c",
827+ "52a70042eff6fbeed1d6c8c0ed2f9cc775a19cc51b395429c4210bc5091520ad"
828+ ),
770829 path: "gix-sec".into(),
771830 relation: Some(Relation::Parent(2)),
772831 },
773832 Addition {
774833 entry_mode: EntryKind::Blob.into(),
775− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
834+ oid: empty_blob_id,
776835 path: "git-sec/2".into(),
777836 relation: Some(Relation::ChildOfParent(1)),
778837 },
779838 Addition {
780839 entry_mode: EntryKind::Blob.into(),
781− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
840+ oid: empty_blob_id,
782841 path: "git-sec/7".into(),
783842 relation: Some(Relation::ChildOfParent(1)),
784843 },
785844 Addition {
786845 entry_mode: EntryKind::Tree.into(),
787− oid: hex_to_id("fd7938a0c18f993c89eda3f40a6d06fa6785833c"),
846+ oid: hex_to_id(
847+ "fd7938a0c18f993c89eda3f40a6d06fa6785833c",
848+ "5b2e08d098c63c2f31c8937c810f77ff005c48833701e0854f690188f1887aae"
849+ ),
788850 path: "git-sec/subdir".into(),
789851 relation: Some(Relation::ChildOfParent(1)),
790852 },
791853 Deletion {
792854 entry_mode: EntryKind::Blob.into(),
793− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
855+ oid: empty_blob_id,
794856 path: "gix-sec/2".into(),
795857 relation: Some(Relation::ChildOfParent(2)),
796858 },
797859 Deletion {
798860 entry_mode: EntryKind::Blob.into(),
799− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
861+ oid: empty_blob_id,
800862 path: "gix-sec/7".into(),
801863 relation: Some(Relation::ChildOfParent(2)),
802864 },
803865 Deletion {
804866 entry_mode: EntryKind::Tree.into(),
805− oid: hex_to_id("fd7938a0c18f993c89eda3f40a6d06fa6785833c"),
867+ oid: hex_to_id(
868+ "fd7938a0c18f993c89eda3f40a6d06fa6785833c",
869+ "5b2e08d098c63c2f31c8937c810f77ff005c48833701e0854f690188f1887aae"
870+ ),
806871 path: "gix-sec/subdir".into(),
807872 relation: Some(Relation::ChildOfParent(2)),
808873 },
809874 Addition {
810875 entry_mode: EntryKind::Blob.into(),
811− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
876+ oid: empty_blob_id,
812877 path: "git-sec/subdir/6".into(),
813878 relation: Some(Relation::ChildOfParent(1)),
814879 },
815880 Deletion {
816881 entry_mode: EntryKind::Blob.into(),
817− oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
882+ oid: empty_blob_id,
818883 path: "gix-sec/subdir/6".into(),
819884 relation: Some(Relation::ChildOfParent(2)),
820885 }
gix-imara-diff/Cargo.toml+0−3
@@ -31,9 +31,6 @@ gix-object = { version = "^0.60.0", path = "../gix-object", features = ["sha1"] · 30 unmodified lines
3131 cov-mark = "2.1.0"
3232 expect-test = "1.4.0"
3333
34−[profile.release]
35−debug = true
36−
3734 # [[bench]]
3835 # name = "git_repo"
3936 # harness = false
justfile+3−0
@@ -201,6 +201,8 @@ unit-tests: · 200 unmodified lines
201201 cargo nextest run -p gix-archive --no-default-features --features tar --no-fail-fast
202202 cargo nextest run -p gix-archive --no-default-features --features tar_gz --no-fail-fast
203203 cargo nextest run -p gix-archive --no-default-features --features zip --no-fail-fast
204+ env GIX_TEST_FIXTURE_HASH=sha1 cargo nextest run -p gix-diff --no-fail-fast
205+ env GIX_TEST_FIXTURE_HASH=sha256 cargo nextest run -p gix-diff --no-fail-fast
204206 cargo nextest run -p gix-status-tests --features gix-features-parallel --no-fail-fast
205207 cargo nextest run -p gix-worktree-state-tests --features gix-features-parallel --no-fail-fast
206208 cargo nextest run -p gix-worktree-tests --features gix-features-parallel --no-fail-fast
@@ -225,6 +227,7 @@ unit-tests: · 18 unmodified lines
225227 cargo nextest run -p gix-odb-tests --features gix-features-parallel --no-fail-fast
226228 env GIX_TEST_FIXTURE_HASH=sha1 cargo nextest run -p gix-pack --all-features --no-fail-fast
227229 env GIX_TEST_FIXTURE_HASH=sha256 cargo nextest run -p gix-pack --all-features --no-fail-fast
230+ env GIX_TEST_FIXTURE_HASH=sha1 cargo nextest run -p gix-diff-tests --no-fail-fast
228231 env GIX_TEST_FIXTURE_HASH=sha256 cargo nextest run -p gix-diff-tests --no-fail-fast
229232 cargo nextest run -p gix-pack-tests --features all-features --no-fail-fast
230233 cargo nextest run -p gix-pack-tests --features gix-features-parallel --no-fail-fast