@@ -63,6 +63,9 @@ pub enum git_push {}
63
63
pub enum git_note { }
64
64
pub enum git_note_iterator { }
65
65
pub enum git_status_list { }
66
+ pub enum git_pathspec { }
67
+ pub enum git_pathspec_match_list { }
68
+ pub enum git_diff { }
66
69
67
70
#[ repr( C ) ]
68
71
pub struct git_revspec {
@@ -692,6 +695,15 @@ pub struct git_remote_head {
692
695
pub symref_target : * mut c_char ,
693
696
}
694
697
698
+ pub type git_pathspec_flag_t = u32 ;
699
+ pub const GIT_PATHSPEC_DEFAULT : u32 = 0 ;
700
+ pub const GIT_PATHSPEC_IGNORE_CASE : u32 = 1 << 0 ;
701
+ pub const GIT_PATHSPEC_USE_CASE : u32 = 1 << 1 ;
702
+ pub const GIT_PATHSPEC_NO_GLOB : u32 = 1 << 2 ;
703
+ pub const GIT_PATHSPEC_NO_MATCH_ERROR : u32 = 1 << 3 ;
704
+ pub const GIT_PATHSPEC_FIND_FAILURES : u32 = 1 << 4 ;
705
+ pub const GIT_PATHSPEC_FAILURES_ONLY : u32 = 1 << 5 ;
706
+
695
707
/// Initialize openssl for the libgit2 library
696
708
#[ cfg( unix) ]
697
709
pub fn openssl_init ( ) {
@@ -1583,6 +1595,41 @@ extern {
1583
1595
repo : * mut git_repository ,
1584
1596
one : * const git_oid ,
1585
1597
two : * const git_oid ) -> c_int ;
1598
+
1599
+ // pathspec
1600
+ pub fn git_pathspec_free ( ps : * mut git_pathspec ) ;
1601
+ pub fn git_pathspec_match_diff ( out : * mut * mut git_pathspec_match_list ,
1602
+ diff : * mut git_diff ,
1603
+ flags : u32 ,
1604
+ ps : * mut git_pathspec ) -> c_int ;
1605
+ pub fn git_pathspec_match_index ( out : * mut * mut git_pathspec_match_list ,
1606
+ index : * mut git_index ,
1607
+ flags : u32 ,
1608
+ ps : * mut git_pathspec ) -> c_int ;
1609
+ pub fn git_pathspec_match_list_diff_entry ( m : * const git_pathspec_match_list ,
1610
+ pos : size_t ) -> * const git_diff_delta ;
1611
+ pub fn git_pathspec_match_list_entry ( m : * const git_pathspec_match_list ,
1612
+ pos : size_t ) -> * const c_char ;
1613
+ pub fn git_pathspec_match_list_entrycount ( m : * const git_pathspec_match_list )
1614
+ -> size_t ;
1615
+ pub fn git_pathspec_match_list_failed_entry ( m : * const git_pathspec_match_list ,
1616
+ pos : size_t ) -> * const c_char ;
1617
+ pub fn git_pathspec_match_list_failed_entrycount (
1618
+ m : * const git_pathspec_match_list ) -> size_t ;
1619
+ pub fn git_pathspec_match_list_free ( m : * const git_pathspec_match_list ) ;
1620
+ pub fn git_pathspec_match_tree ( out : * mut * mut git_pathspec_match_list ,
1621
+ tree : * mut git_tree ,
1622
+ flags : u32 ,
1623
+ ps : * mut git_pathspec ) -> c_int ;
1624
+ pub fn git_pathspec_match_workdir ( out : * mut * mut git_pathspec_match_list ,
1625
+ repo : * mut git_repository ,
1626
+ flags : u32 ,
1627
+ ps : * mut git_pathspec ) -> c_int ;
1628
+ pub fn git_pathspec_matches_path ( ps : * const git_pathspec ,
1629
+ flags : u32 ,
1630
+ path : * const c_char ) -> c_int ;
1631
+ pub fn git_pathspec_new ( out : * mut * mut git_pathspec ,
1632
+ pathspec : * const git_strarray ) -> c_int ;
1586
1633
}
1587
1634
1588
1635
#[ test]
0 commit comments