summaryrefslogtreecommitdiffstats
path: root/vendor/gix-index/src/write.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /vendor/gix-index/src/write.rs
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix-index/src/write.rs')
-rw-r--r--vendor/gix-index/src/write.rs18
1 files changed, 16 insertions, 2 deletions
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<Version> {
+ pub fn write_to(
+ &self,
+ out: impl std::io::Write,
+ Options {
+ extensions,
+ skip_hash: _,
+ }: Options,
+ ) -> std::io::Result<Version> {
+ let _span = gix_features::trace::detail!("gix_index::State::write()");
let version = self.detect_required_version();
let mut write = CountBytes::new(out);