add back git-annex branch read cache

The cache was removed way back in 2012,
commit 3417c55189

Then I forgot I had removed it! I remember clearly multiple times when I
thought, "this reads the same data twice, but the cache will avoid that
being very expensive".

The reason it was removed was it messed up the assistant noticing when
other processes made changes. That same kind of problem has recently
been addressed when adding the optimisation to avoid reading the journal
unnecessarily.

Indeed, enableInteractiveJournalAccess is run in just the
right places, so can just piggyback on it to know when it's not safe
to use the cache.
This commit is contained in:
Joey Hess 2020-07-06 12:09:53 -04:00
parent 9a2fbc2ea8
commit e72ec8b9b2
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
8 changed files with 68 additions and 19 deletions

View file

@ -166,7 +166,7 @@ genTransportHandle = do
let h = TransportHandle (LocalRepo g) annexstate
liftAnnex h $ do
Annex.setOutput QuietOutput
enableInteractiveJournalAccess
enableInteractiveBranchAccess
return h
updateTransportHandle :: TransportHandle -> IO TransportHandle