read inode cache file strictly to avoid failure to drop on windows
Seems that Windows doesn't allow deleting a file that the same process has open. Here the inode cache file was read and a the value from it gets used later. But due to laziness, the old file is still open when it gets deleted. Adding strictness avoids this problem. Of course, the file is small, so it's no problem to read it all strictly, so this is probably an improvement even outside of Windows.
This commit is contained in:
parent
73d2f8b280
commit
1093302eba
1 changed files with 1 additions and 1 deletions
2
Annex/Content/Direct.hs
Normal file → Executable file
2
Annex/Content/Direct.hs
Normal file → Executable file
|
@ -110,7 +110,7 @@ goodContent key file = sameInodeCache file =<< recordedInodeCache key
|
|||
recordedInodeCache :: Key -> Annex [InodeCache]
|
||||
recordedInodeCache key = withInodeCacheFile key $ \f ->
|
||||
liftIO $ catchDefaultIO [] $
|
||||
mapMaybe readInodeCache . lines <$> readFile f
|
||||
mapMaybe readInodeCache . lines <$> readFileStrict f
|
||||
|
||||
{- Caches an inode for a file.
|
||||
-
|
||||
|
|
Loading…
Add table
Reference in a new issue