Skip to content

Commit

Permalink
Added check for different devices.
Browse files Browse the repository at this point in the history
  • Loading branch information
hanbings committed May 27, 2024
1 parent 8011bb7 commit 95f8466
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/find/matchers/samefile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ impl Matcher for SameFileMatcher {
#[cfg(unix)]
fn matches(&self, file_info: &walkdir::DirEntry, _matcher_io: &mut super::MatcherIO) -> bool {
let meta = file_info.metadata().unwrap();

if meta.dev() != self.metadata.dev() {
return false;

Check warning on line 28 in src/find/matchers/samefile.rs

View check run for this annotation

Codecov / codecov/patch

src/find/matchers/samefile.rs#L28

Added line #L28 was not covered by tests
}

meta.ino() == self.metadata.ino()
}

Expand Down

0 comments on commit 95f8466

Please sign in to comment.