Skip to content

Commit

Permalink
Merge pull request #134 from torhovland/infinite-watch-loop-windows
Browse files Browse the repository at this point in the history
Infinite watch loop on Windows
  • Loading branch information
thedodd authored Mar 2, 2021
2 parents 6dc36e7 + e805e0d commit bf27965
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion src/watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit bf27965

Please sign in to comment.