Skip to content

Commit d53880d

Browse files
committed
test(config): Show current git-fetch-with-cli behavior
1 parent 9ca20fa commit d53880d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/testsuite/config_cli.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ use std::{collections::HashMap, fs};
1111
#[cargo_test]
1212
fn basic() {
1313
// Simple example.
14-
let gctx = GlobalContextBuilder::new().config_arg("foo='bar'").build();
14+
let gctx = GlobalContextBuilder::new()
15+
.config_arg("foo='bar'")
16+
.config_arg("net.git-fetch-with-cli=true")
17+
.build();
1518
assert_eq!(gctx.get::<String>("foo").unwrap(), "bar");
19+
assert_eq!(gctx.net_config().unwrap().git_fetch_with_cli, None);
1620
}
1721

1822
#[cargo_test]
@@ -39,13 +43,16 @@ fn cli_priority() {
3943
.env("CARGO_BUILD_JOBS", "2")
4044
.env("CARGO_BUILD_RUSTC", "env")
4145
.env("CARGO_TERM_VERBOSE", "false")
46+
.env("CARGO_NET_GIT_FETCH_WITH_CLI", "false")
4247
.config_arg("build.jobs=1")
4348
.config_arg("build.rustc='cli'")
4449
.config_arg("term.verbose=true")
50+
.config_arg("net.git-fetch-with-cli=true")
4551
.build();
4652
assert_eq!(gctx.get::<i32>("build.jobs").unwrap(), 1);
4753
assert_eq!(gctx.get::<String>("build.rustc").unwrap(), "cli");
4854
assert_eq!(gctx.get::<bool>("term.verbose").unwrap(), true);
55+
assert_eq!(gctx.net_config().unwrap().git_fetch_with_cli, Some(false));
4956

5057
// Setting both term.verbose and term.quiet is invalid and is tested
5158
// in the run test suite.

0 commit comments

Comments
 (0)