@@ -1758,6 +1758,34 @@ git_enum! {
1758
1758
}
1759
1759
}
1760
1760
1761
+ #[ repr( C ) ]
1762
+ pub struct git_worktree_add_options {
1763
+ pub version : c_uint ,
1764
+ pub lock : c_int ,
1765
+ pub reference : * mut git_reference ,
1766
+ }
1767
+
1768
+ pub const GIT_WORKTREE_ADD_OPTIONS_VERSION : u32 = 1 ;
1769
+
1770
+ git_enum ! {
1771
+ pub enum git_worktree_prune_t {
1772
+ /* Prune working tree even if working tree is valid */
1773
+ GIT_WORKTREE_PRUNE_VALID = 1 << 0 ,
1774
+ /* Prune working tree even if it is locked */
1775
+ GIT_WORKTREE_PRUNE_LOCKED = 1 << 1 ,
1776
+ /* Prune checked out working tree */
1777
+ GIT_WORKTREE_PRUNE_WORKING_TREE = 1 << 2 ,
1778
+ }
1779
+ }
1780
+
1781
+ #[ repr( C ) ]
1782
+ pub struct git_worktree_prune_options {
1783
+ pub version : c_uint ,
1784
+ pub flags : u32 ,
1785
+ }
1786
+
1787
+ pub const GIT_WORKTREE_PRUNE_OPTIONS_VERSION : u32 = 1 ;
1788
+
1761
1789
extern "C" {
1762
1790
// threads
1763
1791
pub fn git_libgit2_init ( ) -> c_int ;
@@ -3645,6 +3673,48 @@ extern "C" {
3645
3673
location : git_apply_location_t ,
3646
3674
options : * const git_apply_options ,
3647
3675
) -> c_int ;
3676
+
3677
+ // Worktrees
3678
+ pub fn git_worktree_list ( out : * mut git_strarray , repo : * mut git_repository ) -> c_int ;
3679
+ pub fn git_worktree_lookup (
3680
+ out : * mut * mut git_worktree ,
3681
+ repo : * mut git_repository ,
3682
+ name : * const c_char ,
3683
+ ) -> c_int ;
3684
+ pub fn git_worktree_open_from_repository (
3685
+ out : * mut * mut git_worktree ,
3686
+ repo : * mut git_repository ,
3687
+ ) -> c_int ;
3688
+ pub fn git_worktree_free ( wt : * mut git_worktree ) ;
3689
+ pub fn git_worktree_validate ( wt : * const git_worktree ) -> c_int ;
3690
+ pub fn git_worktree_add_init_options (
3691
+ opts : * mut git_worktree_add_options ,
3692
+ version : c_uint ,
3693
+ ) -> c_int ;
3694
+ pub fn git_worktree_add (
3695
+ out : * mut * mut git_worktree ,
3696
+ repo : * mut git_repository ,
3697
+ name : * const c_char ,
3698
+ path : * const c_char ,
3699
+ opts : * const git_worktree_add_options ,
3700
+ ) -> c_int ;
3701
+ pub fn git_worktree_lock ( wt : * mut git_worktree , reason : * const c_char ) -> c_int ;
3702
+ pub fn git_worktree_unlock ( wt : * mut git_worktree ) -> c_int ;
3703
+ pub fn git_worktree_is_locked ( reason : * mut git_buf , wt : * const git_worktree ) -> c_int ;
3704
+ pub fn git_worktree_name ( wt : * const git_worktree ) -> * const c_char ;
3705
+ pub fn git_worktree_path ( wt : * const git_worktree ) -> * const c_char ;
3706
+ pub fn git_worktree_prune_init_options (
3707
+ opts : * mut git_worktree_prune_options ,
3708
+ version : c_uint ,
3709
+ ) -> c_int ;
3710
+ pub fn git_worktree_is_prunable (
3711
+ wt : * mut git_worktree ,
3712
+ opts : * mut git_worktree_prune_options ,
3713
+ ) -> c_int ;
3714
+ pub fn git_worktree_prune (
3715
+ wt : * mut git_worktree ,
3716
+ opts : * mut git_worktree_prune_options ,
3717
+ ) -> c_int ;
3648
3718
}
3649
3719
3650
3720
pub fn init ( ) {
0 commit comments