diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-05-23 20:48:43 -0400 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-05-23 20:48:43 -0400 |
commit | 144f4c941a268d2e092acda3d14c93dfc643851f (patch) | |
tree | 1e7171a15aa134517efcded36212001427f1b4f2 /src/history.rs | |
parent | 6cb73ca0c90ea703ef297c827d8c53c84804f5a3 (diff) |
make sure to update whenever doing a directory change
Diffstat (limited to 'src/history.rs')
-rw-r--r-- | src/history.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/history.rs b/src/history.rs index d746c30..4667302 100644 --- a/src/history.rs +++ b/src/history.rs @@ -57,6 +57,13 @@ impl DirectoryHistory for HashMap<PathBuf, JoshutoDirList> { Some(mut dir_entry) => { if dir_entry.need_update() { dir_entry.update_contents(&sort_option)? + } else { + let metadata = std::fs::symlink_metadata(&dir_entry.path)?; + + let modified = metadata.modified()?; + if modified > dir_entry.metadata.modified { + dir_entry.update_contents(&sort_option)? + } } Ok(dir_entry) } |