move keys db closure to AutoMerge

This makes git-annex sync also do it, which makes sure that the keys db
info is fresh when doing a sync --content.
This commit is contained in:
Joey Hess 2016-05-16 15:11:14 -04:00
parent 0860731760
commit 4efc26ca6c
Failed to extract signature
2 changed files with 9 additions and 9 deletions

View file

@ -52,8 +52,15 @@ autoMergeFrom branch currbranch mergeconfig commitmode = do
where where
go old = ifM isDirect go old = ifM isDirect
( mergeDirect currbranch old branch (resolveMerge old branch False) mergeconfig commitmode ( mergeDirect currbranch old branch (resolveMerge old branch False) mergeconfig commitmode
, inRepo (Git.Merge.merge branch mergeconfig commitmode) , do
<||> (resolveMerge old branch False <&&> commitResolvedMerge commitmode) r <- inRepo (Git.Merge.merge branch mergeconfig commitmode)
<||> (resolveMerge old branch False <&&> commitResolvedMerge commitmode)
-- Merging can cause new associated files to appear
-- and the smudge filter will add them to the database.
-- To ensure that this process sees those changes,
-- close the database if it was open.
Database.Keys.closeDb
return r
) )
{- Resolves a conflicted merge. It's important that any conflicts be {- Resolves a conflicted merge. It's important that any conflicts be

View file

@ -19,7 +19,6 @@ import qualified Annex.Branch
import qualified Git import qualified Git
import qualified Git.Branch import qualified Git.Branch
import qualified Command.Sync import qualified Command.Sync
import qualified Database.Keys
import Annex.TaggedPush import Annex.TaggedPush
import Remote (remoteFromUUID) import Remote (remoteFromUUID)
@ -90,12 +89,6 @@ onChange file
currbranch mergeConfig currbranch mergeConfig
Git.Branch.AutomaticCommit Git.Branch.AutomaticCommit
changedbranch changedbranch
-- Merging can cause new associated files
-- to appear and the smudge filter will
-- add them to the database. To ensure that
-- this process sees those changes, close
-- the database if it was open.
liftAnnex $ Database.Keys.closeDb
mergecurrent _ = noop mergecurrent _ = noop
handleDesynced = case fromTaggedBranch changedbranch of handleDesynced = case fromTaggedBranch changedbranch of