pub struct Commit<'a> { /* private fields */ }Expand description
What to commit to a tree.
Implementations§
Source§impl<'a> Commit<'a>
impl<'a> Commit<'a>
Sourcepub fn new(message: Option<&'a str>) -> Self
pub fn new(message: Option<&'a str>) -> Self
Everything that changed, with a message or without.
Sourcepub fn with_repositories(self, repositories: &'a [GitRepository]) -> Self
pub fn with_repositories(self, repositories: &'a [GitRepository]) -> Self
Records the Git repositories in the copy as Git describes them: those found new, and what changed of those the tree records, which moved or are gone. Without it, a commit leaves repositories as they are.
Sourcepub fn with_repositories_read_by(
self,
read: &'a dyn Fn(&[String]) -> Vec<GitRepository>,
) -> Self
pub fn with_repositories_read_by( self, read: &'a dyn Fn(&[String]) -> Vec<GitRepository>, ) -> Self
Records the Git repositories in the copy as read describes the folders that the
commit finds holding them, as with Commit::with_repositories: for a program that
asks Git only once the folder is walked.
Sourcepub fn with_paths(self, paths: Vec<String>) -> Self
pub fn with_paths(self, paths: Vec<String>) -> Self
Only what changed at these paths of the tree, or in these folders of it; a move counts if either of its ends does.
Sourcepub fn with_force(self) -> Self
pub fn with_force(self) -> Self
Records on top what changed from a version that is no longer the tree’s, which history keeps, and what was edited from a version this replica does not know.
Sourcepub fn with_secret(self, paths: Vec<String>) -> Self
pub fn with_secret(self, paths: Vec<String>) -> Self
Takes in as secret files the new files at these paths, which no built-in name or
.nibsecret file makes secret; and makes secret the ordinary files committed there:
each becomes a new secret file, the old one deleted, whose versions
Library::purge_made_secret purges once the person agrees.
Sourcepub fn with_ordinary(self, paths: Vec<String>) -> Self
pub fn with_ordinary(self, paths: Vec<String>) -> Self
Takes in as ordinary files the new files at these paths, which would be secret.
Sourcepub fn leaving_secrets(self) -> Self
pub fn leaving_secrets(self) -> Self
Commits the rest where a change of a secret file cannot be sealed, as the secrets are locked or not on this device, which leaves those changes for a later commit.
Trait Implementations§
impl<'a> Eq for Commit<'a>
impl<'a> StructuralPartialEq for Commit<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Commit<'a>
impl<'a> !Send for Commit<'a>
impl<'a> !Sync for Commit<'a>
impl<'a> !UnwindSafe for Commit<'a>
impl<'a> Forget for Commit<'a>
impl<'a> Freeze for Commit<'a>
impl<'a> Move for Commit<'a>
impl<'a> Unpin for Commit<'a>
impl<'a> UnsafeUnpin for Commit<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.