@@ -58,6 +58,8 @@ pub struct PushOptions<'cb> {
58
58
follow_redirects: RemoteRedirect,
59
59
custom_headers: Vec<CString>,
60
60
custom_headers_ptrs: Vec<*const c_char>,
61
+ remote_push_options: Vec<CString>,
62
+ remote_push_options_ptrs: Vec<*const c_char>,
61
63
}
62
64
63
65
/// Holds callbacks for a connection to a `Remote`. Disconnects when dropped
@@ -628,6 +630,8 @@ impl<'cb> PushOptions<'cb> {
628
630
follow_redirects: RemoteRedirect::Initial,
629
631
custom_headers: Vec::new(),
630
632
custom_headers_ptrs: Vec::new(),
633
+ remote_push_options: Vec::new(),
634
+ remote_push_options_ptrs: Vec::new(),
631
635
}
632
636
}
633
637
@@ -673,6 +677,20 @@ impl<'cb> PushOptions<'cb> {
673
677
self.custom_headers_ptrs = self.custom_headers.iter().map(|s| s.as_ptr()).collect();
674
678
self
675
679
}
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
+ }
676
694
}
677
695
678
696
impl<'cb> Binding for PushOptions<'cb> {
@@ -700,6 +718,10 @@ impl<'cb> Binding for PushOptions<'cb> {
700
718
count: self.custom_headers_ptrs.len(),
701
719
strings: self.custom_headers_ptrs.as_ptr() as *mut _,
702
720
},
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
+ },
703
725
}
704
726
}
705
727
}
0 commit comments