disable journalIgnorable in enableInteractiveBranchAccess

Fix a reversion that prevented --batch commands (and the assistant)
from noticing data written to the journal by other commands.

I have not identified which commit broke this for sure,
but probably it was aeca7c2207

--batch commands that wrote to the journal avoided the problem since
journalIgnorable sets unset on write. It's a little bit surprising that
nobody noticed that query --batch commands did not see data written by
other commands.

Sponsored-by: Dartmouth College's DANDI project
This commit is contained in:
Joey Hess 2022-07-15 13:43:46 -04:00
parent 91abd872d3
commit a2b1f369d1
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 21 additions and 5 deletions

View file

@ -2,7 +2,7 @@
-
- Runtime state about the git-annex branch, and a small cache.
-
- Copyright 2011-2021 Joey Hess <id@joeyh.name>
- Copyright 2011-2022 Joey Hess <id@joeyh.name>
-
- Licensed under the GNU AGPL version 3 or higher.
-}
@ -92,9 +92,9 @@ journalChanged = do
-- so avoid an unnecessary write to the MVar that changeState
-- would do.
--
-- This assumes that another thread is not changing journalIgnorable
-- This assumes that another thread is not setting journalIgnorable
-- at the same time, but since runUpdateOnce is the only
-- thing that changes it, and it only runs once, that
-- thing that sets it, and it only runs once, that
-- should not happen.
st <- getState
when (journalIgnorable st) $
@ -109,8 +109,10 @@ journalChanged = do
- will be seen.
-}
enableInteractiveBranchAccess :: Annex ()
enableInteractiveBranchAccess = changeState $
\s -> s { needInteractiveAccess = True }
enableInteractiveBranchAccess = changeState $ \s -> s
{ needInteractiveAccess = True
, journalIgnorable = False
}
setCache :: RawFilePath -> L.ByteString -> Annex ()
setCache file content = changeState $ \s -> s