#[non_exhaustive]pub struct RepackOptions {Show 13 fields
pub dry_run: bool,
pub write_commit_graph: bool,
pub write_bitmap: bool,
pub prune_older_than: Option<OffsetDateTime>,
pub now: Option<OffsetDateTime>,
pub keep_unreachable: bool,
pub threads: Option<usize>,
pub pack_build: Option<PackBuildOptions>,
pub merged_config: Option<ConfigSet>,
pub environment: Environment,
pub incremental: bool,
pub auto_skip: bool,
pub force_recompress: bool,
}Expand description
Options for repack_all().
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.dry_run: boolReport actions without writing packs or deleting files.
write_commit_graph: boolAfter repack, write objects/info/commit-graph when the ODB is files-backed.
write_bitmap: boolAfter repack, write a .bitmap sidecar for the new pack (files-backed only).
prune_older_than: Option<OffsetDateTime>When set, prune unreachable loose objects not newer than this instant after repack.
now: Option<OffsetDateTime>Wall clock passed to maintenance helpers that require an explicit time (e.g. bitmap writes).
keep_unreachable: boolWhen true (the default), do not delete unreachable loose objects after repack (matches git repack -ad).
threads: Option<usize>Worker threads for pack indexing (None reads pack.threads / CPU count).
pack_build: Option<PackBuildOptions>Override the delta settings of a full repack; None uses
PackBuildOptions::for_local_copy (pack.window / pack.depth from config).
A full repack honors delta, window, max_depth, reuse_deltas, reuse_objects,
use_ofs_delta and use_bitmaps. Objects already in a pack keep their stored form
when the reuse flags allow it; only the rest go through the window search.
merged_config: Option<ConfigSet>Config/environment for ingest and pack threads (defaults to repo config).
environment: EnvironmentProcess environment for config discovery and thread counts.
incremental: boolPack only the reachable loose objects into a new pack, keeping existing packs (Git
repack -d without -a). Unreachable loose objects stay loose for the prune step.
When Self::write_bitmap is true and the repository already has pack files, bitmaps are
written via a multi-pack-index sidecar instead of a per-pack .bitmap on the new pack alone.
auto_skip: boolWhen true, gc() may skip repack on a single pack with no loose objects when every
packed object is still reachable and none would be dropped by the active prune policy.
Explicit repack_all / repack leave this false so maintenance still runs.
force_recompress: boolWhen true, recompute every delta instead of keeping the ones stored in packs
(git repack -f, grit repack --force). Whole objects that stay whole are
still copied verbatim.
Implementations§
Source§impl RepackOptions
impl RepackOptions
Sourcepub fn with_dry_run(dry_run: bool) -> Self
pub fn with_dry_run(dry_run: bool) -> Self
Start from Default::default with Self::dry_run set.