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: Kind
The 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 new<T>(
progress: impl Progress,
fetch_refspecs: &[RefSpec],
_: Context<'_, T>,
_: Options,
) -> Result<Self, Error>where
T: Transport,
Available on crate features blocking-client
or async-client
only.
pub fn new<T>(
progress: impl Progress,
fetch_refspecs: &[RefSpec],
_: Context<'_, T>,
_: Options,
) -> 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 for fetching.
A context is provided to bundle what would be additional parameters, and options are used to further configure the call.
progress
is used ifls-refs
is invoked on the remote. Always the case when V2 is used.fetch_refspecs
are all explicit refspecs to identify references on the remote that you are interested in. Note that these are copied toRefMap::refspecs
for convenience, asRefMap::mappings
refer to them by index.