diff --git a/crates/cuddle-please-misc/src/git_client.rs b/crates/cuddle-please-misc/src/git_client.rs index 9512944..06db4df 100644 --- a/crates/cuddle-please-misc/src/git_client.rs +++ b/crates/cuddle-please-misc/src/git_client.rs @@ -79,6 +79,13 @@ impl VcsClient { let stdout = std::str::from_utf8(&checkout_branch.stdout)?; let stderr = std::str::from_utf8(&checkout_branch.stderr)?; tracing::debug!(stdout = stdout, stderr = stderr, "git {}", args.join(" ")); + let exit_code = checkout_branch.status; + if !exit_code.success() { + anyhow::bail!( + "failed to run git command: {}", + exit_code.code().unwrap_or(-1) + ) + } } }