Use the change time in addition to the modified time when detecting untouched files (at least on Unix)

pmeunier
Jul 21, 2021, 1:57 PM
QU6T6J6WEZ6IYZC57YAUCET2V6WHVKJ2Q4UGB2GOK45VIGDPBR2QC

Dependencies

  • [2] EAAJNZ3J Make recursive directory removal optional
  • [*] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [*] VO5OQW4W Removing anyhow in libpijul

Change contents

  • edit in libpijul/src/working_copy/filesystem.rs at line 331
    [4.214660]
    [5.4195]
    #[cfg(not(unix))]
  • edit in libpijul/src/working_copy/filesystem.rs at line 339
    [4.214848]
    [2.158]
    #[cfg(unix)]
    fn modified_time(&self, file: &str) -> Result<std::time::SystemTime, Self::Error> {
    debug!("modified_time {:?}", file);
    use std::os::unix::fs::MetadataExt;
    let attr = std::fs::metadata(&self.path(file))?;
    let ctime = std::time::SystemTime::UNIX_EPOCH + std::time::Duration::from_secs(attr.ctime() as u64);
    Ok(attr.modified()?.min(ctime))
    }