Skip to content

Commit 68d9e80

Browse files
committed
Merge branch 'limit-git'
2 parents b629f8a + 4ed84a6 commit 68d9e80

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

gix-worktree/tests/worktree/checkout.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,12 @@ fn keep_going_collects_results() {
290290
}
291291

292292
if multi_threaded() {
293-
assert_eq!(dir_structure(&destination).len(), 3);
293+
let actual = dir_structure(&destination);
294+
assert!(
295+
(2..=3).contains(&actual.len()),
296+
"it's 3 most of the time, but can be 2 of the 'empty' file is missing as the object couldn't be accessed.\
297+
It's unclear why there isn't more, as it would keep going"
298+
);
294299
} else {
295300
assert_eq!(
296301
stripped_prefix(&destination, &dir_structure(&destination)),
@@ -350,10 +355,9 @@ fn collisions_are_detected_on_a_case_insensitive_filesystem_even_with_delayed_fi
350355

351356
let dest_files = dir_structure(&destination);
352357
if multi_threaded() {
353-
assert_eq!(
354-
dest_files.len(),
355-
5,
356-
"can only assert on number as it's racily creating files so unclear which one clashes"
358+
assert!(
359+
(4..=6).contains(&dest_files.len()),
360+
"due to the clash happening at nearly any time, and keep-going is false, we get a variance of files"
357361
);
358362
} else {
359363
assert_eq!(
@@ -370,10 +374,9 @@ fn collisions_are_detected_on_a_case_insensitive_filesystem_even_with_delayed_fi
370374
let error_kind_dir = error_kind;
371375

372376
if multi_threaded() {
373-
assert_eq!(
374-
outcome.collisions.len(),
375-
5,
376-
"can only assert on number as it's racily creating files so unclear which one clashes"
377+
assert!(
378+
(5..=6).contains(&outcome.collisions.len()),
379+
"can only assert on number as it's racily creating files so unclear which one clashes, and due to keep-going = false there is variance"
377380
);
378381
} else {
379382
assert_eq!(

tests/tools/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,13 +497,16 @@ fn configure_command<'a>(
497497
args: &[String],
498498
script_result_directory: &Path,
499499
) -> &'a mut std::process::Command {
500+
let never_path = if cfg!(windows) { "-" } else { ":" };
500501
cmd.args(args)
501502
.stdout(std::process::Stdio::piped())
502503
.stderr(std::process::Stdio::piped())
503504
.current_dir(script_result_directory)
504505
.env_remove("GIT_DIR")
505506
.env_remove("GIT_ASKPASS")
506507
.env_remove("SSH_ASKPASS")
508+
.env("GIT_CONFIG_SYSTEM", never_path)
509+
.env("GIT_CONFIG_GLOBAL", never_path)
507510
.env("GIT_TERMINAL_PROMPT", "false")
508511
.env("GIT_AUTHOR_DATE", "2000-01-01 00:00:00 +0000")
509512
.env("GIT_AUTHOR_EMAIL", "[email protected]")

0 commit comments

Comments
 (0)