diff options
author | Aria Shrimpton <me@aria.rip> | 2024-01-19 23:43:09 +0000 |
---|---|---|
committer | Aria Shrimpton <me@aria.rip> | 2024-01-19 23:43:09 +0000 |
commit | 8d83fe167a2eb1ec51e9f2a4692c03ceedad80ee (patch) | |
tree | fbfd5f9cdedd5864f29407047e9dafe8a82abfb7 /src/crates | |
parent | 8ab9e6779d714aa3f9bfc769a36a9eae7d61c0f9 (diff) |
fix(cache): ignore some files when calculating tree hash
Diffstat (limited to 'src/crates')
-rw-r--r-- | src/crates/candelabra/src/cache.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/crates/candelabra/src/cache.rs b/src/crates/candelabra/src/cache.rs index ad75c4d..ccb61fd 100644 --- a/src/crates/candelabra/src/cache.rs +++ b/src/crates/candelabra/src/cache.rs @@ -122,7 +122,13 @@ pub fn gen_tree_hash(dir: &Utf8Path) -> Result<u64> { let mut hasher = DefaultHasher::new(); for f in glob(&format!("{}/**/*", dir)).unwrap() { - let modified = metadata(f?)?.modified()?; + let f = f?; + let as_str = f.as_os_str().to_str().unwrap(); + if as_str.contains("target/") || as_str.contains(".pr.rs") { + continue; + } + + let modified = metadata(f)?.modified()?; modified.hash(&mut hasher); } |