From c23a457e72abe608715ac76f076f47dc42af07a5 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 20:31:44 +0200 Subject: Merging upstream version 1.74.1+dfsg1. Signed-off-by: Daniel Baumann --- vendor/gix-index/src/write.rs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'vendor/gix-index/src/write.rs') diff --git a/vendor/gix-index/src/write.rs b/vendor/gix-index/src/write.rs index 43f9b3255..2050ed809 100644 --- a/vendor/gix-index/src/write.rs +++ b/vendor/gix-index/src/write.rs @@ -48,13 +48,27 @@ impl Extensions { /// Note that default options write either index V2 or V3 depending on the content of the entries. #[derive(Debug, Default, Clone, Copy)] pub struct Options { - /// Configures which extensions to write + /// Configures which extensions to write. pub extensions: Extensions, + /// Set the trailing hash of the produced index to all zeroes to save some time. + /// + /// This value is typically controlled by `index.skipHash` and is respected when the index is written + /// via [`File::write()`](crate::File::write()) and [`File::write_to()`](crate::File::write_to()). + /// Note that + pub skip_hash: bool, } impl State { /// Serialize this instance to `out` with [`options`][Options]. - pub fn write_to(&self, out: impl std::io::Write, Options { extensions }: Options) -> std::io::Result { + pub fn write_to( + &self, + out: impl std::io::Write, + Options { + extensions, + skip_hash: _, + }: Options, + ) -> std::io::Result { + let _span = gix_features::trace::detail!("gix_index::State::write()"); let version = self.detect_required_version(); let mut write = CountBytes::new(out); -- cgit v1.2.3