Skip to content

Commit

Permalink
more output when git things go wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
kritzcreek committed Mar 12, 2021
1 parent ec8ca87 commit f97ae57
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,11 @@ fn clone_package(tmp: &Path, dest: &Path, repo: &str, version: &str) -> Result<(
.output()
.context(format!("Failed to clone the repo at {}", repo))?;
if !clone_result.status.success() {
return Err(anyhow::anyhow!("Failed to clone the repo at: {}", repo));
return Err(anyhow::anyhow!(
"Failed to clone the repo at: {}\nwith:\n{}",
repo,
std::str::from_utf8(&clone_result.stderr).unwrap()
));
}

let repo_dir = tmp_dir.path().join("repo");
Expand All @@ -314,9 +318,10 @@ fn clone_package(tmp: &Path, dest: &Path, repo: &str, version: &str) -> Result<(
))?;
if !checkout_result.status.success() {
return Err(anyhow::anyhow!(
"Failed to checkout version {} for the repo at: {}",
"Failed to checkout version {} for the repo at: {}\nwith:\n{}",
version,
repo
repo,
std::str::from_utf8(&checkout_result.stderr).unwrap()
));
}

Expand Down

0 comments on commit f97ae57

Please sign in to comment.