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 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); }