fix(git): make sure we always fail on exit code != 0
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
675947ed1e
commit
51ca73a53b
@ -79,6 +79,13 @@ impl VcsClient {
|
|||||||
let stdout = std::str::from_utf8(&checkout_branch.stdout)?;
|
let stdout = std::str::from_utf8(&checkout_branch.stdout)?;
|
||||||
let stderr = std::str::from_utf8(&checkout_branch.stderr)?;
|
let stderr = std::str::from_utf8(&checkout_branch.stderr)?;
|
||||||
tracing::debug!(stdout = stdout, stderr = stderr, "git {}", args.join(" "));
|
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)
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user