From 6b46ad9809b42d355c883ff2c75f8ac75d4bd989 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Mon, 19 Aug 2024 07:43:09 +0100 Subject: test(remote): fix first test run if binaries in git-exec-path are copied to tmp-git-exec-path if the dir doesnt exist some enties fail to copy which was causing the first test to hang --- test_utils/src/lib.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'test_utils/src/lib.rs') diff --git a/test_utils/src/lib.rs b/test_utils/src/lib.rs index 6c177bc..84ae8a9 100644 --- a/test_utils/src/lib.rs +++ b/test_utils/src/lib.rs @@ -1021,9 +1021,11 @@ where .trim() .to_string(), ); - for entry in std::fs::read_dir(src)? { - let src_path = entry?.path(); - std::fs::copy(&src_path, &git_exec_dir.join(src_path.file_name().unwrap()))?; + for entry in (std::fs::read_dir(src)?).flatten() { + let src_path = entry.path(); + if let Some(name) = src_path.file_name() { + let _ = std::fs::copy(&src_path, &git_exec_dir.join(name)); + } } } std::fs::copy( -- cgit v1.2.3