Skip to content

Commit

Permalink
add binding for git_apply_to_tree (#720)
Browse files Browse the repository at this point in the history
  • Loading branch information
arxanas authored Jun 14, 2021
1 parent b055a28 commit 7d12405
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2891,6 +2891,26 @@ impl Repository {
}
}

/// Apply a Diff to the provided tree, and return the resulting Index.
pub fn apply_to_tree(
&self,
tree: &Tree<'_>,
diff: &Diff<'_>,
options: Option<&mut ApplyOptions<'_>>,
) -> Result<Index, Error> {
let mut ret = ptr::null_mut();
unsafe {
try_call!(raw::git_apply_to_tree(
&mut ret,
self.raw,
tree.raw(),
diff.raw(),
options.map(|s| s.raw()).unwrap_or(ptr::null())
));
Ok(Binding::from_raw(ret))
}
}

/// Reverts the given commit, producing changes in the index and working directory.
pub fn revert(
&self,
Expand Down

0 comments on commit 7d12405

Please sign in to comment.