git-annex/Types/BranchState.hs
Joey Hess aeca7c2207
Sped up query commands that read the git-annex branch by around 5%
The only price paid is one additional MVar read per write to the journal.
Presumably writing a journal file dominiates over a MVar read time by
several orders of magnitude.

--batch does not get the speedup because then it needs to notice when
another process has made a change. Also made the assistant and other damon
modes bypass the optimisation, which would not help them anyway.
2020-04-09 13:54:43 -04:00

24 lines
707 B
Haskell

{- git-annex BranchState data type
-
- Copyright 2011 Joey Hess <id@joeyh.name>
-
- Licensed under the GNU AGPL version 3 or higher.
-}
module Types.BranchState where
data BranchState = BranchState
{ branchUpdated :: Bool
-- ^ has the branch been updated this run?
, indexChecked :: Bool
-- ^ has the index file been checked to exist?
, journalIgnorable :: Bool
-- ^ can reading the journal be skipped, while still getting
-- sufficiently up-to-date information from the branch?
, journalNeverIgnorable :: Bool
-- ^ should the journal always be read even if it would normally
-- be safe to skip it?
}
startBranchState :: BranchState
startBranchState = BranchState False False False False