Skip to content

Commit

Permalink
tests: Tweak git_ls_files
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Oct 10, 2023
1 parent 9e29733 commit 28ff3ae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/auxiliary/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,11 @@ fn test_project(model: &str) -> Result<(TempDir, PathBuf)> {
fn git_ls_files(dir: &Path, filters: &[&str]) -> Result<Vec<(String, PathBuf)>> {
let mut cmd = Command::new("git");
cmd.arg("ls-files").args(filters).current_dir(dir);
let output = cmd.output().with_context(|| format!("failed to run `{cmd:?}`"))?;
let output = cmd.output().with_context(|| format!("could not execute process `{cmd:?}`"))?;
if !output.status.success() {
bail!(
"failed to run `{cmd:?}`:\nstdout:\n-------\n{}\n-------\nstderr:\n-------\n{}\n-------",
"process didn't exit successfully: `{cmd:?}`:\n\nSTDOUT:\n{0}\n{1}\n{0}\n\nSTDERR:\n{0}\n{2}\n{0}\n",
"-".repeat(60),
String::from_utf8_lossy(&output.stdout),
String::from_utf8_lossy(&output.stderr),
);
Expand Down

0 comments on commit 28ff3ae

Please sign in to comment.