Skip to content

Commit 9bf5d05

Browse files
committed
fix(rs): check git review exit status
1 parent bf440fd commit 9bf5d05

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

rs/src/modules/setup_repo.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::config::MWUtilConfig;
22
use crate::types::RepoOrigin;
33
use crate::utils::set_git_config;
4-
use anyhow::anyhow;
4+
use anyhow::{anyhow, bail};
55
use clap::Args;
66
use std::env;
77
use std::path::PathBuf;
@@ -47,10 +47,13 @@ pub fn setup_gerrit(config: &MWUtilConfig, args: SetupRepoArgs) -> anyhow::Resul
4747
&repo_folder
4848
)?;
4949
set_git_config("gitreview.remote", "origin", &repo_folder)?;
50-
Command::new("git")
50+
let status = Command::new("git")
5151
.args(["review", "-s", "--verbose"])
5252
.current_dir(repo_folder)
5353
.status()?;
54+
if !status.success() {
55+
bail!("git review setup failed!");
56+
}
5457
Ok(())
5558
}
5659

0 commit comments

Comments
 (0)