This commit is contained in:
Joey Hess 2017-09-20 16:22:32 -04:00
parent ad36479b3e
commit 129418615b
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 27 additions and 22 deletions

View file

@ -16,10 +16,7 @@ import Types.Key
import Backend
import Remote.Helper.Encryptable (isEncrypted)
import Database.Export
import Logs.Export
import Annex.Export
import Annex.LockFile
import Git.Sha
import qualified Data.Map as M
import Control.Concurrent.STM
@ -103,16 +100,8 @@ adjustExportable r = case M.lookup "exporttree" (config r) of
-- updates the database, to notice when an export has been
-- updated from another repository.
let getexportlocs = \k -> do
whenM updateonce $ withExclusiveLock (gitAnnexExportLock (uuid r)) $ do
old <- liftIO $ fromMaybe emptyTree
<$> getExportTreeCurrent db
l <- getExport (uuid r)
case map exportedTreeish l of
(new:[]) | new /= old -> do
updateExportTree db old new
liftIO $ recordExportTreeCurrent db new
liftIO $ flushDbQueue db
_ -> return ()
whenM updateonce $
updateExportTreeFromLog db
liftIO $ getExportTree db k
return $ r