Skip to content

Commit 0f685f6

Browse files
committed
Auto merge of #13930 - ehuss:squelch-git-output, r=weihanglo
Fix warning output in build_with_symlink_to_path_dependency_with_build_script_in_git The test `build_with_symlink_to_path_dependency_with_build_script_in_git` was emitting a large warning block (in my case, about init.defaultBranch) because it was running `git` without filtering its output. It's not clear to me why this test was shelling out to `git` instead of using the built-in test support functions. From what I can tell, this should be exactly equivalent, and silences the warning output.
2 parents 198ba31 + 2e9dcdb commit 0f685f6

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

tests/testsuite/build.rs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ use cargo::{
99
use cargo_test_support::paths::{root, CargoPathExt};
1010
use cargo_test_support::registry::Package;
1111
use cargo_test_support::{
12-
basic_bin_manifest, basic_lib_manifest, basic_manifest, cargo_exe, git, is_nightly, main_file,
13-
paths, process, project, rustc_host, sleep_ms, symlink_supported, t, Execs, ProjectBuilder,
12+
basic_bin_manifest, basic_lib_manifest, basic_manifest, cargo_exe, cargo_process, compare, git,
13+
is_nightly, main_file, paths, process, project, rustc_host, sleep_ms, symlink_supported, t,
14+
tools, Execs, ProjectBuilder,
1415
};
15-
use cargo_test_support::{cargo_process, compare};
16-
use cargo_test_support::{git_process, tools};
1716
use cargo_util::paths::dylib_path_envvar;
1817
use std::env;
1918
use std::fs;
@@ -72,16 +71,8 @@ fn build_with_symlink_to_path_dependency_with_build_script_in_git() {
7271
.build();
7372

7473
// It is necessary to have a sub-repository and to add files so there is an index.
75-
git_process("init")
76-
.cwd(root.join("original"))
77-
.build_command()
78-
.status()
79-
.unwrap();
80-
git_process("add .")
81-
.cwd(root.join("original"))
82-
.build_command()
83-
.status()
84-
.unwrap();
74+
let repo = git::init(&root.join("original"));
75+
git::add(&repo);
8576
cargo_process("build").run()
8677
}
8778

0 commit comments

Comments
 (0)