@@ -58,6 +58,8 @@ pub struct PushOptions<'cb> {
5858 follow_redirects : RemoteRedirect ,
5959 custom_headers : Vec < CString > ,
6060 custom_headers_ptrs : Vec < * const c_char > ,
61+ remote_push_options : Vec < CString > ,
62+ remote_push_options_ptrs : Vec < * const c_char > ,
6163}
6264
6365/// Holds callbacks for a connection to a `Remote`. Disconnects when dropped
@@ -628,6 +630,8 @@ impl<'cb> PushOptions<'cb> {
628630 follow_redirects : RemoteRedirect :: Initial ,
629631 custom_headers : Vec :: new ( ) ,
630632 custom_headers_ptrs : Vec :: new ( ) ,
633+ remote_push_options : Vec :: new ( ) ,
634+ remote_push_options_ptrs : Vec :: new ( ) ,
631635 }
632636 }
633637
@@ -673,6 +677,20 @@ impl<'cb> PushOptions<'cb> {
673677 self . custom_headers_ptrs = self . custom_headers . iter ( ) . map ( |s| s. as_ptr ( ) ) . collect ( ) ;
674678 self
675679 }
680+
681+ /// Set "push options" to deliver to the remote.
682+ pub fn remote_push_options ( & mut self , remote_push_options : & [ & str ] ) -> & mut Self {
683+ self . remote_push_options = remote_push_options
684+ . iter ( )
685+ . map ( |& s| CString :: new ( s) . unwrap ( ) )
686+ . collect ( ) ;
687+ self . remote_push_options_ptrs = self
688+ . remote_push_options
689+ . iter ( )
690+ . map ( |s| s. as_ptr ( ) )
691+ . collect ( ) ;
692+ self
693+ }
676694}
677695
678696impl < ' cb > Binding for PushOptions < ' cb > {
@@ -700,6 +718,10 @@ impl<'cb> Binding for PushOptions<'cb> {
700718 count : self . custom_headers_ptrs . len ( ) ,
701719 strings : self . custom_headers_ptrs . as_ptr ( ) as * mut _ ,
702720 } ,
721+ remote_push_options : git_strarray {
722+ count : self . remote_push_options . len ( ) ,
723+ strings : self . remote_push_options_ptrs . as_ptr ( ) as * mut _ ,
724+ } ,
703725 }
704726 }
705727}
0 commit comments