e1c18ddec4
All commands that often have to read a lot of information from the git-annex branch should now be nearly as fast as before the branch was introduced. Before fsck was taking approximatly 3 hours, now it's running in 8 minutes. The code is very nasty. It should be rewritten to read the header line from git cat-file, and then read the specified number of bytes of content.
24 lines
584 B
Haskell
24 lines
584 B
Haskell
{- git-annex BranchState data type
|
|
-
|
|
- Copyright 2011 Joey Hess <joey@kitenet.net>
|
|
-
|
|
- Licensed under the GNU GPL version 3 or higher.
|
|
-}
|
|
|
|
module Types.BranchState where
|
|
|
|
import System.IO
|
|
|
|
data BranchState = BranchState {
|
|
branchUpdated :: Bool, -- has the branch been updated this run?
|
|
|
|
-- (from, to) handles used to talk to a git-cat-file process
|
|
catFileHandles :: Maybe (Handle, Handle),
|
|
|
|
-- the content of one file is cached
|
|
cachedFile :: Maybe FilePath,
|
|
cachedContent :: String
|
|
}
|
|
|
|
startBranchState :: BranchState
|
|
startBranchState = BranchState False Nothing Nothing ""
|