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§
source§impl 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.