Struct PullOptions

Source
pub struct PullOptions { /* private fields */ }
Expand description

git pull command.

use mhgit::{CommandOptions, Repository};
use mhgit::commands::PullOptions;

let repo = Repository::new();
PullOptions::new()
    .remote("origin")
    .refspec("master")
    .run(&repo)?;

Implementations§

Source§

impl PullOptions

Source

pub fn new() -> PullOptions

Create a new set of git pull options.

Source

pub fn allow_unrelated(&mut self, val: bool) -> &mut PullOptions

Add –allow-unrelated option.

Source

pub fn refspec(&mut self, file: impl ToString) -> &mut PullOptions

Add refspec to pull command.

Source

pub fn refspecs<I, S>(&mut self, files: I) -> &mut PullOptions
where I: IntoIterator<Item = S>, S: ToString,

Add multiple refspecs to pull command.

Source

pub fn remote(&mut self, repo: impl ToString) -> &mut PullOptions

Set remote repository source.

Trait Implementations§

Source§

impl CommandOptions for PullOptions

Source§

type Output = ()

Source§

fn git_args(&self) -> Vec<&str>

Return a vector of the arguments passed to git. Read more
Source§

fn parse_output(&self, out: &str) -> Result<Self::Output, Error>

Parse the captured stdout into an appropriate rust type.
Source§

fn run(&self, repo: &Repository) -> Result<Self::Output, Error>

Run the command in the given git repository. Calling git and parsing and return the output of the command, if any. Read more
Source§

impl Debug for PullOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PullOptions

Source§

fn default() -> PullOptions

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.