Struct git2::FetchOptions
source · pub struct FetchOptions<'cb> { /* private fields */ }
Expand description
Options which can be specified to various fetch operations.
Implementations§
source§impl<'cb> FetchOptions<'cb>
impl<'cb> FetchOptions<'cb>
sourcepub fn new() -> FetchOptions<'cb>
pub fn new() -> FetchOptions<'cb>
Creates a new blank set of fetch options
sourcepub fn remote_callbacks(&mut self, cbs: RemoteCallbacks<'cb>) -> &mut Self
pub fn remote_callbacks(&mut self, cbs: RemoteCallbacks<'cb>) -> &mut Self
Set the callbacks to use for the fetch operation.
sourcepub fn proxy_options(&mut self, opts: ProxyOptions<'cb>) -> &mut Self
pub fn proxy_options(&mut self, opts: ProxyOptions<'cb>) -> &mut Self
Set the proxy options to use for the fetch operation.
sourcepub fn prune(&mut self, prune: FetchPrune) -> &mut Self
pub fn prune(&mut self, prune: FetchPrune) -> &mut Self
Set whether to perform a prune after the fetch.
sourcepub fn update_fetchhead(&mut self, update: bool) -> &mut Self
pub fn update_fetchhead(&mut self, update: bool) -> &mut Self
Set whether to write the results to FETCH_HEAD.
Defaults to true
.
sourcepub fn depth(&mut self, depth: i32) -> &mut Self
pub fn depth(&mut self, depth: i32) -> &mut Self
Set fetch depth, a value less or equal to 0 is interpreted as pull everything (effectively the same as not declaring a limit depth).
Set how to behave regarding tags on the remote, such as auto-downloading tags for objects we’re downloading or downloading all of them.
The default is to auto-follow tags.
sourcepub fn follow_redirects(&mut self, redirect: RemoteRedirect) -> &mut Self
pub fn follow_redirects(&mut self, redirect: RemoteRedirect) -> &mut Self
Set remote redirection settings; whether redirects to another host are permitted.
By default, git will follow a redirect on the initial request
(/info/refs
), but not subsequent requests.
sourcepub fn custom_headers(&mut self, custom_headers: &[&str]) -> &mut Self
pub fn custom_headers(&mut self, custom_headers: &[&str]) -> &mut Self
Set extra headers for this fetch operation.