note about a wart
authorJoey Hess <joeyh@joeyh.name>
Mon, 24 May 2021 16:05:35 +0000 (12:05 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 24 May 2021 16:05:49 +0000 (12:05 -0400)
All code that uses associated files already deals with this problem,
which used to be worse. Unfortunately I was not able to entirely
eliminate it, although it happens in fewer cases now.

Database/Keys.hs

index 7f800491577494fde86fc2fa41d9b8dafc8dcf03..a7ef6c7933b9d200c1b3b690b0df0278f79e43d6 100644 (file)
@@ -218,6 +218,14 @@ isInodeKnown i s = or <$> runReaderIO ((:[]) <$$> SQL.isInodeKnown i s)
  - filter. If a drop missed the file then the file is added back into the
  - annex. If a get missed the file then the clean filter populates the
  - file.
+ -
+ - There is a situation where, after this has run, the database can still
+ - contain associated files that have been deleted from the index.
+ - That happens when addAssociatedFile is used to record a newly
+ - added file, but that file then gets removed from the index before
+ - this is run. Eg, "git-annex add foo; git rm foo"
+ - So when using getAssociatedFiles, have to make sure the file still
+ - is an associated file.
  -}
 reconcileStaged :: H.DbQueue -> Annex ()
 reconcileStaged qh = do