pub fn new(repo: &'a Repository, path: &'a Path) -> Result<Self, Error> {
        // Validate that the path is relative for better feedback to API users
        if path.has_root() {
            fail!(
                ErrorKind::BadParam,
                "{} is not a relative path",
                path.display()
            );
        }
        let commit_id = repo.repo.refname_to_id("HEAD")?;
        let commit = repo.repo.find_commit(commit_id)?;
        commit.tree()?.get_path(path)?;
        Ok(GitPath { repo, path })
    }
/// Creates a new `GitPath`, validating that this file is tracked in Git
Creates a new `GitPath`, validating that this file is tracked in Git
Creates a new ` GitPath ` validating that this file is tracked in Git
pub fn new(repo: &'a Repository, path: &'a Path) -> Result<Self, Error> {
        // Validate that the path is relative for better feedback to API users
        if path.has_root() {
            fail!(
                ErrorKind::BadParam,
                "{} is not a relative path",
                path.display()
            );
        }
        let commit_id = repo.repo.refname_to_id("HEAD")?;
        let commit = repo.repo.find_commit(commit_id)?;
        commit.tree()?.get_path(path)?;
        Ok(GitPath { repo, path })
    }
pub fn new ( repo : & ' a Repository , path : & ' a Path ) -> Result < Self , Error > { // Validate that the path is relative for better feedback to API users if path . has_root ( ) { fail ! ( ErrorKind BadParam " " path display ( ) ) ; } let commit_id = repo . repo . refname_to_id ( " " ) ? ; let commit = repo . repo . find_commit ( commit_id ) ? ; commit . tree ( ) ? . get_path ( path ) ? ; Ok ( GitPath { repo , path } ) }
Creates a new `GitPath`, validating that this file is tracked in Git
Creates a new ` GitPath ` validating that this file is tracked in Git
repo
&'a Repository
path
&'a Path
repo
&'a Repository
path
&'a Path