We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
git_apply_to_tree
1 parent b055a28 commit 7d12405Copy full SHA for 7d12405
src/repo.rs
@@ -2891,6 +2891,26 @@ impl Repository {
2891
}
2892
2893
2894
+ /// Apply a Diff to the provided tree, and return the resulting Index.
2895
+ pub fn apply_to_tree(
2896
+ &self,
2897
+ tree: &Tree<'_>,
2898
+ diff: &Diff<'_>,
2899
+ options: Option<&mut ApplyOptions<'_>>,
2900
+ ) -> Result<Index, Error> {
2901
+ let mut ret = ptr::null_mut();
2902
+ unsafe {
2903
+ try_call!(raw::git_apply_to_tree(
2904
+ &mut ret,
2905
+ self.raw,
2906
+ tree.raw(),
2907
+ diff.raw(),
2908
+ options.map(|s| s.raw()).unwrap_or(ptr::null())
2909
+ ));
2910
+ Ok(Binding::from_raw(ret))
2911
+ }
2912
2913
+
2914
/// Reverts the given commit, producing changes in the index and working directory.
2915
pub fn revert(
2916
&self,
0 commit comments