Skip to content

Commit

Permalink
Merge pull request #132 from rockisch/master
Browse files Browse the repository at this point in the history
Allow subfolders of git repo
  • Loading branch information
spenserblack authored Oct 30, 2019
2 parents cf068a3 + 2dd7ff3 commit 110811a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl std::fmt::Debug for Error {
Error::GitNotInstalled => "Git failed to execute",
Error::NoGitData => "Could not retrieve git configuration data",
Error::ReadDirectory => "Could not read directory",
Error::NotGitRepo => "This is not a Git Repo",
Error::NotGitRepo => "Could not find a valid git repo on the current path",
Error::ReferenceInfoError => "Error while retrieving reference information",
Error::ImageLoadError => "Could not load the specified image",
};
Expand Down
4 changes: 2 additions & 2 deletions src/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ impl Info {
}

fn get_current_commit_info(dir: &str) -> Result<CommitInfo> {
let repo = Repository::open(dir).map_err(|_| Error::NotGitRepo)?;
let repo = Repository::discover(dir).map_err(|_| Error::NotGitRepo)?;
let head = repo.head().map_err(|_| Error::ReferenceInfoError)?;
let head_oid = head.target().ok_or(Error::ReferenceInfoError)?;
let refs = repo.references().map_err(|_| Error::ReferenceInfoError)?;
Expand All @@ -350,7 +350,7 @@ impl Info {
}

fn get_configuration(dir: &str) -> Result<Configuration> {
let repo = Repository::open(dir).map_err(|_| Error::NotGitRepo)?;
let repo = Repository::discover(dir).map_err(|_| Error::NotGitRepo)?;
let config = repo.config().map_err(|_| Error::NoGitData)?;
let mut remote_url = String::new();
let mut repository_name = String::new();
Expand Down

0 comments on commit 110811a

Please sign in to comment.