diff --git a/git-pack/src/bundle/mod.rs b/git-pack/src/bundle/mod.rs index 70653f122e0..0f5fb77ca23 100644 --- a/git-pack/src/bundle/mod.rs +++ b/git-pack/src/bundle/mod.rs @@ -34,7 +34,7 @@ mod verify { self.index.verify_integrity( Some(crate::index::verify::PackContext { data: &self.pack, - verify_mode: verify_mode, + verify_mode, traversal_algorithm: traversal, make_cache_fn: make_pack_lookup_cache, }), diff --git a/git-pack/src/index/traverse/error.rs b/git-pack/src/index/traverse/error.rs index c3f28613a17..3c86b23093a 100644 --- a/git-pack/src/index/traverse/error.rs +++ b/git-pack/src/index/traverse/error.rs @@ -23,7 +23,7 @@ pub enum Error { expected: git_hash::ObjectId, actual: git_hash::ObjectId, }, - #[error("The SHA1 of {kind} object at offset {offset} didn't match the checksum in the index file: expected {expected}, got {actual}")] + #[error("The hash of {kind} object at offset {offset} didn't match the checksum in the index file: expected {expected}, got {actual}")] PackObjectMismatch { expected: git_hash::ObjectId, actual: git_hash::ObjectId, diff --git a/git-pack/src/index/verify.rs b/git-pack/src/index/verify.rs index bd4398833e6..d49f782c994 100644 --- a/git-pack/src/index/verify.rs +++ b/git-pack/src/index/verify.rs @@ -38,14 +38,14 @@ pub mod checksum { /// Various ways in which a pack and index can be verified #[derive(Debug, Eq, PartialEq, Hash, Clone, Copy)] pub enum Mode { - /// Validate SHA1 and CRC32 - Sha1Crc32, - /// Validate SHA1 and CRC32, and decode each non-Blob object. + /// Validate the object hash and CRC32 + HashCrc32, + /// Validate hash and CRC32, and decode each non-Blob object. /// Each object should be valid, i.e. be decodable. - Sha1Crc32Decode, - /// Validate SHA1 and CRC32, and decode and encode each non-Blob object. + HashCrc32Decode, + /// Validate hash and CRC32, and decode and encode each non-Blob object. /// Each object should yield exactly the same hash when re-encoded. - Sha1Crc32DecodeEncode, + HashCrc32DecodeEncode, } /// Information to allow verifying the integrity of an index with the help of its corresponding pack. @@ -175,7 +175,7 @@ impl index::File { where P: Progress, { - if let Mode::Sha1Crc32Decode | Mode::Sha1Crc32DecodeEncode = mode { + if let Mode::HashCrc32Decode | Mode::HashCrc32DecodeEncode = mode { use git_object::Kind::*; match object_kind { Tree | Commit | Tag => { @@ -186,7 +186,7 @@ impl index::File { id: index_entry.oid, } })?; - if let Mode::Sha1Crc32DecodeEncode = mode { + if let Mode::HashCrc32DecodeEncode = mode { encode_buf.clear(); object .write_to(&mut *encode_buf) diff --git a/git-pack/tests/pack/data/output/count_and_entries.rs b/git-pack/tests/pack/data/output/count_and_entries.rs index e97dec700f6..dc73fc7433d 100644 --- a/git-pack/tests/pack/data/output/count_and_entries.rs +++ b/git-pack/tests/pack/data/output/count_and_entries.rs @@ -391,7 +391,7 @@ fn write_and_verify( } bundle.verify_integrity( - pack::index::verify::Mode::Sha1Crc32DecodeEncode, + pack::index::verify::Mode::HashCrc32DecodeEncode, pack::index::traverse::Algorithm::Lookup, || pack::cache::Never, None, diff --git a/git-pack/tests/pack/index.rs b/git-pack/tests/pack/index.rs index 41b0e2f27eb..d4587fc019d 100644 --- a/git-pack/tests/pack/index.rs +++ b/git-pack/tests/pack/index.rs @@ -200,9 +200,9 @@ mod file { ]; static MODES: &[index::verify::Mode] = &[ - index::verify::Mode::Sha1Crc32, - index::verify::Mode::Sha1Crc32Decode, - index::verify::Mode::Sha1Crc32DecodeEncode, + index::verify::Mode::HashCrc32, + index::verify::Mode::HashCrc32Decode, + index::verify::Mode::HashCrc32DecodeEncode, ]; #[test] diff --git a/gitoxide-core/src/pack/verify.rs b/gitoxide-core/src/pack/verify.rs index d2b7624c972..5ba53baaad5 100644 --- a/gitoxide-core/src/pack/verify.rs +++ b/gitoxide-core/src/pack/verify.rs @@ -75,7 +75,7 @@ impl Default for Context, Vec> { Context { output_statistics: None, thread_limit: None, - mode: index::verify::Mode::Sha1Crc32, + mode: index::verify::Mode::HashCrc32, algorithm: Algorithm::LessMemory, out: Vec::new(), err: Vec::new(), diff --git a/src/plumbing/main.rs b/src/plumbing/main.rs index 3b13887273c..82a98c08410 100644 --- a/src/plumbing/main.rs +++ b/src/plumbing/main.rs @@ -287,9 +287,9 @@ pub fn main() -> Result<()> { None, move |progress, out, err| { let mode = match (decode, re_encode) { - (true, false) => verify::Mode::Sha1Crc32Decode, - (true, true) | (false, true) => verify::Mode::Sha1Crc32DecodeEncode, - (false, false) => verify::Mode::Sha1Crc32, + (true, false) => verify::Mode::HashCrc32Decode, + (true, true) | (false, true) => verify::Mode::HashCrc32DecodeEncode, + (false, false) => verify::Mode::HashCrc32, }; let output_statistics = if statistics { Some(format) } else { None }; verify::pack_or_pack_index(