Direct mode: Support filesystems like FAT which can change their inodes each time they are mounted.

This commit is contained in:
Joey Hess 2013-02-19 16:26:07 -04:00
parent 0f4cc559a7
commit 624e34649f
7 changed files with 69 additions and 15 deletions

View file

@ -304,8 +304,8 @@ prepSendAnnex key = withObjectLoc key indirect direct
direct (f:fs) = do
cache <- recordedInodeCache key
-- check that we have a good file
ifM (liftIO $ compareInodeCache f cache)
( return $ Just (f, liftIO $ compareInodeCache f cache)
ifM (sameInodeCache f cache)
( return $ Just (f, sameInodeCache f cache)
, direct fs
)
@ -356,7 +356,7 @@ removeAnnex key = withObjectLoc key remove removedirect
cache <- recordedInodeCache key
removeInodeCache key
mapM_ (resetfile cache) fs
resetfile cache f = whenM (liftIO $ compareInodeCache f cache) $ do
resetfile cache f = whenM (sameInodeCache f cache) $ do
l <- calcGitLink f key
top <- fromRepo Git.repoPath
cwd <- liftIO getCurrentDirectory