[go: up one dir, main page]

git2 0.1.0

Bindings to libgit2 for interoperating with git repositories. This library is both threadsafe and memory safe and allows both reading and writing git repositories.
use Object;

/// A revspec represents a range of revisions within a repository.
pub struct Revspec<'a> {
    from: Option<Object<'a>>,
    to: Option<Object<'a>>,
}

impl<'a> Revspec<'a> {
    /// Assembles a new revspec from the from/to components.
    pub fn from_objects<'a>(from: Option<Object<'a>>,
                            to: Option<Object<'a>>) -> Revspec<'a> {
        Revspec { from: from, to: to }
    }

    /// Access the `from` range of this revspec.
    pub fn from(&self) -> Option<&Object<'a>> { self.from.as_ref() }

    /// Access the `to` range of this revspec.
    pub fn to(&self) -> Option<&Object<'a>> { self.to.as_ref() }
}