remove Eq instance for InodeCache
There are two types of equality here, and which one is right varies, so this forces me to consider and choose between them. Based on this, I learned that the commit in git anex sync was always doing a strong comparison, even when in a repository where the inodes had changed. Fixed that.
This commit is contained in:
parent
eef93fc0a5
commit
40df015d90
4 changed files with 19 additions and 11 deletions
|
@ -109,11 +109,10 @@ ingest (Just source) = do
|
|||
backend <- chooseBackend $ keyFilename source
|
||||
k <- genKey source backend
|
||||
cache <- liftIO $ genInodeCache $ contentLocation source
|
||||
case inodeCache source of
|
||||
Nothing -> go k cache
|
||||
Just c
|
||||
| (Just c == cache) -> go k cache
|
||||
| otherwise -> failure
|
||||
case (cache, inodeCache source) of
|
||||
(_, Nothing) -> go k cache
|
||||
(Just newc, Just c) | compareStrong c newc -> go k cache
|
||||
_ -> failure
|
||||
where
|
||||
go k cache = ifM isDirect ( godirect k cache , goindirect k cache )
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue