Skip to main content

HttpFetchPackRequest

Struct HttpFetchPackRequest 

Source
pub struct HttpFetchPackRequest<'a> {
Show 16 fields pub client: &'a UreqHttpClient, pub git_dir: &'a Path, pub format: ObjectFormat, pub remote: &'a RemoteUrl, pub wants: Vec<ObjectId>, pub haves: Option<Vec<ObjectId>>, pub shallow: Vec<ObjectId>, pub deepen: Option<u32>, pub promisor: bool, pub max_input_size: Option<u64>, pub filter: Option<PackObjectFilter>, pub deepen_since: Option<i64>, pub deepen_not: Vec<String>, pub deepen_relative: bool, pub git_protocol: Option<&'a str>, pub omit_haves: bool,
}
Expand description

Fetch wants from an HTTP upload-pack remote into the repository at git_dir, installing the resulting pack. Objects already present locally are skipped (for non-shallow fetches); promisor selects promisor-pack installation.

When deepen is set the fetch is shallow: the request replays shallow (the client’s current boundary, read from $GIT_DIR/shallow) and asks the server to truncate history to deepen commits. The returned ProtocolV2FetchShallowInfo entries are the server’s shallow-info updates the caller must fold into $GIT_DIR/shallow (see crate::apply_shallow_info); they are empty for a non-deepen fetch.

Fields§

§client: &'a UreqHttpClient

HTTP client used for smart-HTTP RPCs.

§git_dir: &'a Path

Local repository $GIT_DIR.

§format: ObjectFormat

Local repository object format.

§remote: &'a RemoteUrl

Resolved HTTP(S) remote.

§wants: Vec<ObjectId>

Wanted object ids.

§haves: Option<Vec<ObjectId>>

Caller-selected negotiation haves. None means advertise the default local haves.

§shallow: Vec<ObjectId>

Existing shallow boundary to replay.

§deepen: Option<u32>

Requested deepen depth, if this is a shallow fetch.

§promisor: bool

Whether to install the response as a promisor pack.

§max_input_size: Option<u64>

Maximum raw pack bytes to accept from the remote (fetch.maxInputSize / transfer.maxSize). None means unlimited.

§filter: Option<PackObjectFilter>§deepen_since: Option<i64>§deepen_not: Vec<String>§deepen_relative: bool§git_protocol: Option<&'a str>§omit_haves: bool

Send no have lines. Used by a partial clone’s checkout-blob top-up fetch: the client already has the commit whose tree references the wanted blob, so advertising it as a have would make the server treat the blob as already transferred (reachable from the have) and omit it. Suppressing haves forces the server to send the explicitly wanted objects.

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.