From e805a1e8c1f0216dd5400b1c97e01d8d34acbb31 Mon Sep 17 00:00:00 2001 From: Razz4780 Date: Mon, 2 Dec 2024 10:51:30 +0100 Subject: [PATCH] Fix trailing slash case --- mirrord/layer/src/file/filter/read_local_by_default.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mirrord/layer/src/file/filter/read_local_by_default.rs b/mirrord/layer/src/file/filter/read_local_by_default.rs index 875910cc273..a51bd4901b3 100644 --- a/mirrord/layer/src/file/filter/read_local_by_default.rs +++ b/mirrord/layer/src/file/filter/read_local_by_default.rs @@ -94,7 +94,10 @@ pub fn regex_set_builder() -> RegexSetBuilder { // Hidden files and directories in $HOME. if let Ok(home) = env::var("HOME") { - patterns.push(format!("^{}/\\.", regex::escape(&home))) + patterns.push(format!( + "^{}/\\.", + regex::escape(home.trim_end_matches('/')) + )) } RegexSetBuilder::new(patterns)