pub struct ReceivePolicy {
pub deny_non_fast_forwards: bool,
pub deny_deletes: bool,
pub deny_current_branch: bool,
pub deny_delete_current: bool,
pub fsck_objects: Option<ObjectFsckPolicy>,
pub shallow_update: bool,
}Expand description
Which pushed objects and ref updates the server refuses.
Fields§
§deny_non_fast_forwards: boolRefuse branch (refs/heads/*) updates that would discard commits
(receive.denyNonFastForwards). Other refs are not checked.
deny_deletes: boolRefuse ref deletions (receive.denyDeletes).
deny_current_branch: boolIn a repository with a working tree, refuse to update or delete the
branch HEAD points at (receive.denyCurrentBranch).
deny_delete_current: boolRefuse to delete the branch HEAD points at, in a bare repository as
well as one with a working tree (receive.denyDeleteCurrent).
fsck_objects: Option<ObjectFsckPolicy>Check every pushed commit, tree and tag with this policy before any of
them enters the repository (receive.fsckObjects). One refused object
refuses the whole push with UnpackError::Rejected. None skips the
check.
shallow_update: boolAccept pushes from a shallow client that would make this repository
shallow at one of the client’s boundaries (receive.shallowUpdate).
The new boundaries are added to the repository’s shallow file.
When false, such updates are refused with
RefUpdateRefusal::ShallowUpdateNotAllowed; pushes whose history the
repository already holds below the client’s boundaries are accepted
either way.
Implementations§
Source§impl ReceivePolicy
impl ReceivePolicy
Sourcepub fn from_config(config: &ConfigSet) -> Self
pub fn from_config(config: &ConfigSet) -> Self
Read the policy from the receive.* configuration keys.
receive.denyCurrentBranch accepts Git’s values: refuse, true or
unset refuse the update; ignore, warn, false and updateInstead
allow it (this server does not update the working tree).
receive.denyDeleteCurrent is the same, except that updateInstead
refuses: there is no working tree to update for a deleted branch.
Pushed objects are checked when receive.fsckObjects is true, or when it
is unset and transfer.fsckObjects is true. A value that is not a
boolean turns the check on rather than silently leaving it off. The
check uses receive.fsck.<msg-id> overrides and receive.fsck.skipList
(see ObjectFsckPolicy::from_config).
§Parameters
config: the repository’s loaded configuration.
§Returns
The policy, with defaults for unset or unparseable keys.
Trait Implementations§
Source§impl Clone for ReceivePolicy
impl Clone for ReceivePolicy
Source§impl Debug for ReceivePolicy
impl Debug for ReceivePolicy
Source§impl Default for ReceivePolicy
impl Default for ReceivePolicy
impl Eq for ReceivePolicy
Source§impl PartialEq for ReceivePolicy
impl PartialEq for ReceivePolicy
impl StructuralPartialEq for ReceivePolicy
Auto Trait Implementations§
impl Freeze for ReceivePolicy
impl RefUnwindSafe for ReceivePolicy
impl Send for ReceivePolicy
impl Sync for ReceivePolicy
impl Unpin for ReceivePolicy
impl UnsafeUnpin for ReceivePolicy
impl UnwindSafe for ReceivePolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.