in unexport, check for annexobjects presence before updating location log

The key may still be in the annexobjects location.
This commit is contained in:
Joey Hess 2024-08-02 18:43:10 -04:00
parent 069d90eab5
commit c4352adf6a
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 17 additions and 6 deletions

View file

@ -1,6 +1,6 @@
{- git-annex command
-
- Copyright 2017-2023 Joey Hess <id@joeyh.name>
- Copyright 2017-2024 Joey Hess <id@joeyh.name>
-
- Licensed under the GNU AGPL version 3 or higher.
-}
@ -21,6 +21,7 @@ import Git.Types
import Git.FilePath
import Git.Sha
import qualified Remote
import qualified Types.Remote as Remote
import Types.Remote
import Types.Export
import Annex.Export
@ -29,6 +30,7 @@ import Annex.Transfer
import Annex.CatFile
import Annex.FileMatcher
import Annex.RemoteTrackingBranch
import Annex.SpecialRemote.Config
import Logs.Location
import Logs.Export
import Logs.PreferredContent
@ -387,7 +389,15 @@ cleanupUnexport r db eks loc = do
concat <$> forM eks (getExportedLocation db)
when (null remaininglocs) $
forM_ eks $ \ek ->
logChange ek (uuid r) InfoMissing
-- When annexobject=true, a key that
-- was unexported may still be present
-- on the remote.
if annexObjects (Remote.config r)
then tryNonAsync (checkPresent r ek) >>= \case
Right False ->
logChange ek (uuid r) InfoMissing
_ -> noop
else logChange ek (uuid r) InfoMissing
removeEmptyDirectories r db loc eks