From 1133a1988c32238e54551b374f67e928e01e0576 Mon Sep 17 00:00:00 2001 From: Tor Hovland Date: Tue, 23 Feb 2021 22:06:17 +0100 Subject: [PATCH 1/2] Need to canonicalize also the ignore list paths. --- src/watch.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/watch.rs b/src/watch.rs index 266e00f6..b9d77383 100644 --- a/src/watch.rs +++ b/src/watch.rs @@ -99,7 +99,12 @@ impl WatchSystem { } } - fn update_ignore_list(&mut self, path: PathBuf) { + fn update_ignore_list(&mut self, arg_path: PathBuf) { + let path = match arg_path.canonicalize() { + Ok(canon_path) => canon_path, + Err(_) => arg_path, + }; + if !self.ignored_paths.contains(&path) { self.ignored_paths.push(path); } From e805e0d80bbb1dbf896d0b4d64cd37fb19c0413f Mon Sep 17 00:00:00 2001 From: Tor Hovland Date: Tue, 23 Feb 2021 22:11:37 +0100 Subject: [PATCH 2/2] Described the fix of #133. --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 83ad12ec..ea1a16c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ This changelog follows the patterns described here: https://keepachangelog.com/e Subheadings to categorize changes are `added, changed, deprecated, removed, fixed, security`. ## Unreleased +### fixed +- Fixed [#133](https://github.com/thedodd/trunk/issues/133) where `watch` was infinitely looping on Windows +because the canonicalization path didn't match the un-canonicalized ignore list. ## 0.8.2 & 0.8.1 ### fixed