pub struct RefMap {
pub mappings: Vec<Mapping>,
pub refspecs: Vec<RefSpec>,
pub extra_refspecs: Vec<RefSpec>,
pub fixes: Vec<Fix>,
pub remote_refs: Vec<Ref>,
pub object_hash: Kind,
}fetch only.Expand description
Information about the relationship between our refspecs, and remote references with their local counterparts.
It’s the first stage that offers connection to the server, and is typically required to perform one or more fetch operations.
Fields§
§mappings: Vec<Mapping>A mapping between a remote reference and a local tracking branch.
refspecs: Vec<RefSpec>The explicit refspecs that were supposed to be used for fetching.
Typically, they are configured by the remote and are referred to by
refmap::SpecIndex::ExplicitInRemote in refmap::Mapping.
extra_refspecs: Vec<RefSpec>Refspecs which have been added implicitly due to settings of the remote, usually pre-initialized from
extra_refspecs in RefMap options.
They are referred to by refmap::SpecIndex::Implicit in refmap::Mapping.
They are never persisted nor are they typically presented to the user.
fixes: Vec<Fix>Information about the fixes applied to the mapping due to validation and sanitization.
remote_refs: Vec<Ref>All refs advertised by the remote.
object_hash: KindThe kind of hash used for all data sent by the server, if understood by this client implementation.
It was extracted from the handshake as advertised by the server.
Implementations§
Source§impl RefMap
impl RefMap
Sourcepub fn fetch<T>(
progress: impl Progress,
capabilities: &Capabilities,
transport: &mut T,
user_agent: (&'static str, Option<Cow<'static, str>>),
trace_packetlines: bool,
prefix_from_spec_as_filter_on_remote: bool,
context: Context,
) -> Result<Self, Error>where
T: Transport,
Available on crate features blocking-client or async-client only.
pub fn fetch<T>(
progress: impl Progress,
capabilities: &Capabilities,
transport: &mut T,
user_agent: (&'static str, Option<Cow<'static, str>>),
trace_packetlines: bool,
prefix_from_spec_as_filter_on_remote: bool,
context: Context,
) -> Result<Self, Error>where
T: Transport,
blocking-client or async-client only.Create a new instance by obtaining all references on the remote that have been filtered through our remote’s specs for fetching.
progressis used ifls-refsis invoked on the remote. Always the case when V2 is used.capabilitiesare the capabilities of the server, obtained by a handshake.transportis a way to communicate with the server to obtain the reference listing.user_agentis passed to the server.trace_packetlinestraces all packet lines iftrue, for debugging primarily.prefix_from_spec_as_filter_on_remote- Use a two-component prefix derived from the ref-spec’s source, like
refs/heads/to let the server pre-filter refs with great potential for savings in traffic and local CPU time.
- Use a two-component prefix derived from the ref-spec’s source, like
contextto provide more configuration.
Sourcepub fn from_refs(
remote_refs: Vec<Ref>,
capabilities: &Capabilities,
context: Context,
) -> Result<RefMap, Error>
Available on crate features blocking-client or async-client only.
pub fn from_refs( remote_refs: Vec<Ref>, capabilities: &Capabilities, context: Context, ) -> Result<RefMap, Error>
blocking-client or async-client only.Create a ref-map from already obtained remote_refs. Use context to pass in refspecs.
capabilities are used to determine the object format.