mirror of
https://github.com/martinvonz/jj.git
synced 2025-05-28 02:21:12 +00:00
cli: complete: fix stderr during autocomplete of revsets
When running `cmd.spawn()` rust will by default inherit the stderr of the parent, so `jj log test<TAB>`, would print `There is no jj repo in "."` into the prompt.
This commit is contained in:
parent
98724278c5
commit
f1e91cdab5
@ -472,6 +472,7 @@ fn all_files_from_rev(rev: String, current: &std::ffi::OsStr) -> Vec<CompletionC
|
||||
.arg("--config=ui.allow-filesets=true")
|
||||
.arg(current_prefix_to_fileset(current))
|
||||
.stdout(std::process::Stdio::piped())
|
||||
.stderr(std::process::Stdio::null())
|
||||
.spawn()
|
||||
.map_err(user_error)?;
|
||||
let stdout = child.stdout.take().unwrap();
|
||||
|
@ -819,4 +819,8 @@ fn test_files() {
|
||||
f_not_yet_renamed
|
||||
f_unchanged
|
||||
");
|
||||
|
||||
let outside_repo = test_env.env_root();
|
||||
let stdout = test_env.jj_cmd_success(outside_repo, &["--", "jj", "log", "f_"]);
|
||||
insta::assert_snapshot!(stdout, @r"");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user