Skip to content

Commit f3a4266

Browse files
ankddevlpil
authored andcommitted
fix: return old behaviour for some cases
1 parent ec46ff7 commit f3a4266

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

compiler-cli/src/dependencies.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,17 @@ fn provide_local_package(
788788
fn execute_command(command: &mut Command) -> Result<std::process::Output> {
789789
let result = command.output();
790790
match result {
791-
Ok(output) => Ok(output),
791+
Ok(output) if output.status.success() => Ok(output),
792+
Ok(output) => {
793+
let reason = match String::from_utf8(output.stderr) {
794+
Ok(stderr) => ShellCommandFailureReason::ShellCommandError(stderr),
795+
Err(_) => ShellCommandFailureReason::Unknown,
796+
};
797+
Err(Error::ShellCommand {
798+
program: "git".into(),
799+
reason,
800+
})
801+
}
792802
Err(error) => Err(match error.kind() {
793803
ErrorKind::NotFound => Error::ShellProgramNotFound {
794804
program: "git".into(),

0 commit comments

Comments
 (0)