fix inode cache consistency bug when a merge unlocks a present file
Since the file was present and locked, its annex object was not in the inode cache. So, despite not needing to update the annex object when the clean filter is run on the content by git merge, it does need to record the inode cache of the annex object. Otherwise, the annex object will be assumed to be bad, since its inode is not cached.
This commit is contained in:
parent
b6b34f4916
commit
2e9341a47d
1 changed files with 9 additions and 6 deletions
|
@ -544,12 +544,16 @@ data FromTo = From | To
|
||||||
-}
|
-}
|
||||||
linkAnnex :: FromTo -> Key -> FilePath -> Maybe InodeCache -> FilePath -> Annex LinkAnnexResult
|
linkAnnex :: FromTo -> Key -> FilePath -> Maybe InodeCache -> FilePath -> Annex LinkAnnexResult
|
||||||
linkAnnex _ _ _ Nothing _ = return LinkAnnexFailed
|
linkAnnex _ _ _ Nothing _ = return LinkAnnexFailed
|
||||||
linkAnnex fromto key src (Just srcic) dest =
|
linkAnnex fromto key src (Just srcic) dest = do
|
||||||
ifM (liftIO $ doesFileExist dest)
|
mdestic <- withTSDelta (liftIO . genInodeCache dest)
|
||||||
( do
|
case mdestic of
|
||||||
Database.Keys.addInodeCaches key [srcic]
|
Just destic -> do
|
||||||
|
cs <- Database.Keys.getInodeCaches key
|
||||||
|
if null cs
|
||||||
|
then Database.Keys.addInodeCaches key [srcic, destic]
|
||||||
|
else Database.Keys.addInodeCaches key [srcic]
|
||||||
return LinkAnnexNoop
|
return LinkAnnexNoop
|
||||||
, ifM (linkOrCopy key src dest)
|
Nothing -> ifM (linkOrCopy key src dest)
|
||||||
( do
|
( do
|
||||||
thawContent $ case fromto of
|
thawContent $ case fromto of
|
||||||
From -> dest
|
From -> dest
|
||||||
|
@ -557,7 +561,6 @@ linkAnnex fromto key src (Just srcic) dest =
|
||||||
checksrcunchanged
|
checksrcunchanged
|
||||||
, failed
|
, failed
|
||||||
)
|
)
|
||||||
)
|
|
||||||
where
|
where
|
||||||
failed = do
|
failed = do
|
||||||
Database.Keys.addInodeCaches key [srcic]
|
Database.Keys.addInodeCaches key [srcic]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue