Skip to content

Commit 0e451d0

Browse files
committed
Fix and enable disallow_shell test on Windows
The `disallow_shell` test case for `gix-command` has two parts. The first part runs a command that would fail if not really run in a shell, mostly to verify that the second part of the test is robust enough. The second part actually tests the `Prepare::without_shell` method. While neither part should be made any less robust, only the first part had failed on Windows, and the reason was (or had become) only that it would not really run in a shell, due to being eligible for manual argument splitting and `allow_manual_arg_splitting` being `true` by default on Windows. Therefore, this modifies the first part to use a method that sets `allow_manual_arg_splitting` to `false`. This is sufficient to make the test pass on Windows, so this also enables it on all platforms.
1 parent 1e7d09d commit 0e451d0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

gix-command/tests/command.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -459,10 +459,9 @@ mod spawn {
459459
}
460460

461461
#[test]
462-
#[cfg(unix)]
463462
fn disallow_shell() -> crate::Result {
464463
let out = gix_command::prepare("PATH= echo hi")
465-
.command_may_be_shell_script()
464+
.command_may_be_shell_script_disallow_manual_argument_splitting()
466465
.spawn()?
467466
.wait_with_output()?;
468467
assert_eq!(out.stdout.as_bstr(), "hi\n");

0 commit comments

Comments
 (0)