Struct git2::build::TreeUpdateBuilder
source · [−]pub struct TreeUpdateBuilder { /* private fields */ }
Expand description
A builder struct for git tree updates, for use with git_tree_create_updated
.
Implementations
sourceimpl TreeUpdateBuilder
impl TreeUpdateBuilder
sourcepub fn remove<T: IntoCString>(&mut self, path: T) -> &mut Self
pub fn remove<T: IntoCString>(&mut self, path: T) -> &mut Self
Add an update removing the specified path
from a tree.
sourcepub fn upsert<T: IntoCString>(
&mut self,
path: T,
id: Oid,
filemode: FileMode
) -> &mut Self
pub fn upsert<T: IntoCString>(
&mut self,
path: T,
id: Oid,
filemode: FileMode
) -> &mut Self
Add an update setting the specified path
to a specific Oid, whether it currently exists
or not.
Note that libgit2 does not support an upsert of a previously removed path, or an upsert that changes the type of an object (such as from tree to blob or vice versa).
sourcepub fn create_updated(
&mut self,
repo: &Repository,
baseline: &Tree<'_>
) -> Result<Oid, Error>
pub fn create_updated(
&mut self,
repo: &Repository,
baseline: &Tree<'_>
) -> Result<Oid, Error>
Create a new tree from the specified baseline and this series of updates.
The baseline tree must exist in the specified repository.
Trait Implementations
sourceimpl Default for TreeUpdateBuilder
impl Default for TreeUpdateBuilder
impl Send for TreeUpdateBuilder
Auto Trait Implementations
impl RefUnwindSafe for TreeUpdateBuilder
impl !Sync for TreeUpdateBuilder
impl Unpin for TreeUpdateBuilder
impl UnwindSafe for TreeUpdateBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more