aboutsummaryrefslogtreecommitdiff
path: root/Annex/Direct.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-06-11 17:51:12 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-06-12 13:42:21 -0400
commit34c9eab951a73f06de70170cc2c2d40ce490ea70 (patch)
treeb74bc50d26a7667b6ef9c4826fb575252d655103 /Annex/Direct.hs
parent8550dd4bb75f03700fbebd7cf1b38cb2ef8b29f5 (diff)
fix for Windows file timestamp timezone madness
On Windows, changing the time zone causes the apparent mtime of files to change. This confuses git-annex, which natually thinks this means the files have actually been modified (since THAT'S WHAT A MTIME IS FOR, BILL <sheesh>). Work around this stupidity, by using the inode sentinal file to detect if the timezone has changed, and calculate a TSDelta, which will be applied when generating InodeCaches. This should add no overhead at all on unix. Indeed, I sped up a few things slightly in the refactoring. Seems to basically work! But it has a big known problem: If the timezone changes while the assistant (or a long-running command) runs, it won't notice, since it only checks the inode cache once, and so will use the old delta for all new inode caches it generates for new files it's added. Which will result in them seeming changed the next time it runs. This commit was sponsored by Vincent Demeester.
Diffstat (limited to 'Annex/Direct.hs')
-rw-r--r--Annex/Direct.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Annex/Direct.hs b/Annex/Direct.hs
index 70188ea11..e3dbfb6d8 100644
--- a/Annex/Direct.hs
+++ b/Annex/Direct.hs
@@ -53,11 +53,11 @@ stageDirect = do
{- Determine what kind of modified or deleted file this is, as
- efficiently as we can, by getting any key that's associated
- with it in git, as well as its stat info. -}
- go (file, Just sha, Just mode) = do
+ go (file, Just sha, Just mode) = withTSDelta $ \delta -> do
shakey <- catKey sha mode
mstat <- liftIO $ catchMaybeIO $ getSymbolicLinkStatus file
filekey <- isAnnexLink file
- case (shakey, filekey, mstat, toInodeCache =<< mstat) of
+ case (shakey, filekey, mstat, toInodeCache delta =<< mstat) of
(_, Just key, _, _)
| shakey == filekey -> noop
{- A changed symlink. -}