Struct PushOptions

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

git push command.

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

let repo = Repository::new();
PushOptions::new()
    .run(&repo)?;

Implementations§

Source§

impl PushOptions

Source

pub fn new() -> PushOptions

Create a new set of git tag options.

Source

pub fn all(&mut self, val: bool) -> &mut PushOptions

Add –all option.

Source

pub fn tags(&mut self, val: bool) -> &mut PushOptions

Add –tags option.

Source

pub fn force(&mut self, val: bool) -> &mut PushOptions

Add –force option.

Source

pub fn set_upstream(&mut self, val: bool) -> &mut PushOptions

Add –set-upstream option.

Source

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

Add refspec to push command.

Source

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

Add multiple refspecs to push command.

Source

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

Set remote repository source.

Trait Implementations§

Source§

impl CommandOptions for PushOptions

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 PushOptions

Source§

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

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

impl Default for PushOptions

Source§

fn default() -> PushOptions

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.