pub struct PushRefSpec {
pub src: Option<ObjectId>,
pub src_ref: Option<String>,
pub dst: String,
pub force: bool,
pub delete: bool,
pub expected_old: Option<ObjectId>,
pub expect_absent: bool,
pub hook_src_ref: Option<String>,
}Expand description
A single ref update requested by a push.
Fields§
§src: Option<ObjectId>The source object to push (None for a deletion).
src_ref: Option<String>Local source ref name when known (for reports and git push --porcelain).
dst: StringThe destination ref on the remote (e.g. refs/heads/main).
force: boolWhether a non-fast-forward update is allowed.
delete: boolWhether this update deletes the remote ref.
expected_old: Option<ObjectId>Compare-and-swap expectation: the remote ref’s current value must match
this (force-with-lease). None disables the value check.
expect_absent: boolForce-with-lease expectation that the remote ref does not currently
exist. When true, a push whose destination already exists on the remote
is rejected as stale (used for “create only” pushes whose lease is the
ref’s absence). Independent of Self::expected_old.
hook_src_ref: Option<String>Local ref as the pre-push hook names it, when that differs from
Self::src_ref: HEAD for a HEAD:<dst> push, where src_ref holds the
branch HEAD points at. None uses src_ref.