Skip to main content

GcOptions

Struct GcOptions 

Source
#[non_exhaustive]
pub struct GcOptions { pub repack: RepackOptions, pub expire_reflog: bool, pub now_unix: i64, pub pack_refs: bool, pub write_commit_graph: bool, pub drop_large_blobs: bool, }
Expand description

Options for gc().

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§repack: RepackOptions

Repack options applied before pruning unreachable objects.

§expire_reflog: bool

Expire reflogs using gc.reflogExpire* before repack/prune.

§now_unix: i64

Unix seconds for reflog expiry rules.

§pack_refs: bool

When true, pack loose refs before other gc steps.

§write_commit_graph: bool

When true, write objects/info/commit-graph after repack/prune.

Changed-path Bloom filters are kept when the existing graph has them and are not added otherwise, matching git gc.

§drop_large_blobs: bool

When true (the default), run the drop-large-blobs phase after repack if maintenance.drop-large-blobs.enabled is set (see drop_promised_blobs). False never runs it. The phase takes its recency cutoff from Self::now_unix and is skipped (DropPromisedBlobsSkip::NoCurrentTime) when that is 0.

Implementations§

Source§

impl GcOptions

Source

pub fn with_repack_dry_run(dry_run: bool, now_unix: i64) -> Self

Run gc with repack dry-run control and an explicit wall-clock for reflog expiry.

Source

pub fn with_reflog_policy(now_unix: i64, expire_reflog: bool) -> Self

Default repack with explicit reflog expiry policy and wall-clock.

Source

pub fn full_run(dry_run: bool, now_unix: i64) -> Self

Full maintenance run: pack-refs, reflog expiry, repack, prune, commit-graph.

Trait Implementations§

Source§

impl Clone for GcOptions

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GcOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for GcOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.