summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-11-12 12:12:06 +0100
committerMatthias Beyer <mail@beyermatthias.de>2021-11-12 12:12:06 +0100
commit9cccb150fb084712339c7de5096f1b93711f00c3 (patch)
treef16525d9827b7928c10700ef679389b108dc4383 /src
parent492be316c4dde88e3b9ae08810074a2d0c0e5c27 (diff)
parente3d4b9ce040bea5e684de131c9c9ce54d2fe30ee (diff)
Merge branch 'simplify-no-repo-error-output' into next
Diffstat (limited to 'src')
-rw-r--r--src/main.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index 5b0ddba..c0ee15a 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -102,11 +102,13 @@ async fn main() -> Result<()> {
let repo = git2::Repository::discover(PathBuf::from("."))
.map_err(|e| match e.code() {
- git2::ErrorCode::NotFound => anyhow!("Failed to load the git repository from ./."),
+ git2::ErrorCode::NotFound => {
+ eprintln!("Butido must be executed within the package repository");
+ std::process::exit(1)
+ },
_ => Error::from(e),
- })
- .context("Loading the git repository")
- .context("Butido must be executed within the package repository")?;
+ })?;
+
let repo_path = repo
.workdir()
.ok_or_else(|| anyhow!("Not a repository with working directory. Cannot do my job!"))?;