File tree 2 files changed +31
-0
lines changed
2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -3470,6 +3470,14 @@ extern "C" {
3470
3470
commit : * mut git_commit ,
3471
3471
options : * const git_cherrypick_options ,
3472
3472
) -> c_int ;
3473
+ pub fn git_cherrypick_commit (
3474
+ out : * mut * mut git_index ,
3475
+ repo : * mut git_repository ,
3476
+ cherrypick_commit : * mut git_commit ,
3477
+ our_commit : * mut git_commit ,
3478
+ mainline : c_uint ,
3479
+ merge_options : * const git_merge_options ,
3480
+ ) -> c_int ;
3473
3481
}
3474
3482
3475
3483
pub fn init ( ) {
Original file line number Diff line number Diff line change @@ -2469,6 +2469,29 @@ impl Repository {
2469
2469
}
2470
2470
}
2471
2471
2472
+ /// Create an index of uncommitted changes, representing the result of
2473
+ /// cherry-picking.
2474
+ pub fn cherrypick_commit (
2475
+ & self ,
2476
+ cherrypick_commit : & Commit < ' _ > ,
2477
+ our_commit : & Commit < ' _ > ,
2478
+ mainline : u32 ,
2479
+ options : Option < & MergeOptions > ,
2480
+ ) -> Result < Index , Error > {
2481
+ let mut ret = ptr:: null_mut ( ) ;
2482
+ unsafe {
2483
+ try_call ! ( raw:: git_cherrypick_commit(
2484
+ & mut ret,
2485
+ self . raw( ) ,
2486
+ cherrypick_commit. raw( ) ,
2487
+ our_commit. raw( ) ,
2488
+ mainline,
2489
+ options. map( |o| o. raw( ) )
2490
+ ) ) ;
2491
+ Ok ( Binding :: from_raw ( ret) )
2492
+ }
2493
+ }
2494
+
2472
2495
/// Retrieves the name of the reference supporting the remote tracking branch,
2473
2496
/// given the name of a local branch reference.
2474
2497
pub fn branch_upstream_name ( & self , refname : & str ) -> Result < Buf , Error > {
You can’t perform that action at this time.
0 commit comments