-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better handling of directory mod times.
Mirror is fundamentally based on mod times, i.e. latest mod time wins. This works great for files, but directories are a bit different, because any new/changed file in a directory, updates the directory's own mod time to an OS-generated value. In general we don't want to bother with keeping these in-sync across local/remote, so now we explicitly ignore this case. Deletions also don't work well with mod times, b/c a deletion doesn't really have a time in the file system anymore; previously we added the old mod time + 1 second immediately when the delete happened, but this could result in an ignored write, hwen our "now + 1 second" hueristic was artificially ahead of an actual now + < 1 second write on the just-deleted file. We still need to fudge with mod times on "deleted then restored via mv" files, to ensure their still-in-the-past-b/c-it-was-restored mod time "wins" over the deletion mark, so we recognize when that is happening and bump the restored file's mod time ahead by 1 second.
- Loading branch information
Showing
2 changed files
with
59 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters