pub enum Ref {
Peeled {
full_ref_name: BString,
tag: ObjectId,
object: ObjectId,
},
Direct {
full_ref_name: BString,
object: ObjectId,
},
Symbolic {
full_ref_name: BString,
target: BString,
tag: Option<ObjectId>,
object: ObjectId,
},
Unborn {
full_ref_name: BString,
target: BString,
},
}
Available on crate features blocking-client
or async-client
only.
Expand description
A git reference, commonly referred to as ‘ref’, as returned by a git server before sending a pack.
A ref pointing to a tag
object, which in turns points to an object
, usually a commit
Fields
The name at which the ref is located, like refs/tags/1.0
.
The hash of the tag the ref points to.
The hash of the object the tag
points to.
A ref pointing to a commit object
Fields
The name at which the ref is located, like refs/heads/main
or refs/tags/v1.0
for lightweight tags.
The hash of the object the ref points to.
A symbolic ref pointing to target
ref, which in turn, ultimately after possibly following tag
, points to an object
Fields
The name at which the symbolic ref is located, like HEAD
.
The path of the ref the symbolic ref points to, like refs/heads/main
.
See issue #205 for details
The hash of the annotated tag the ref points to, if present.
Note that this field is also None
if full_ref_name
is a lightweight tag.
The hash of the object the target
ref ultimately points to.
A ref is unborn on the remote and just points to the initial, unborn branch, as is the case in a newly initialized repository
or dangling symbolic refs.
Fields
The name at which the ref is located, typically HEAD
.
The path of the ref the symbolic ref points to, like refs/heads/main
, even though the target
does not yet exist.
Provide shared fields referring to the ref itself, namely (name, target, [peeled])
.
In case of peeled refs, the tag object itself is returned as it is what the ref directly refers to, and target of the tag is returned
as peeled
.
If unborn
, the first object id will be the null oid.
Performs copy-assignment from
source
.
Read more
Formats the value using the given formatter.
Read more
Deserialize this value from the given Serde deserializer.
Read more
Compares and returns the maximum of two values.
Read more
Compares and returns the minimum of two values.
Read more
Restrict a value to a certain interval.
Read more
Tests for self
and other
values to be equal, and is used by ==
.
Tests for !=
. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
This method returns an ordering between
self
and
other
values if one exists.
Read more
Tests less than (for
self
and
other
) and is used by the
<
operator.
Read more
Tests less than or equal to (for
self
and
other
) and is used by the
<=
operator.
Read more
Tests greater than (for
self
and
other
) and is used by the
>
operator.
Read more
Tests greater than or equal to (for
self
and
other
) and is used by
the
>=
operator.
Read more
Serialize this value into the given Serde serializer.
Read more
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
🔬This is a nightly-only experimental API. (clone_to_uninit
)
Performs copy-assignment from
self
to
dst
.
Read more
Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more
Uses borrowed data to replace owned data, usually by cloning.
Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.