summaryrefslogtreecommitdiff
path: root/Types/BranchState.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-06-29 21:23:40 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-06-29 21:47:31 -0400
commite1c18ddec455e5d1259ab46ccccbe6a9c7079de6 (patch)
tree260e2570f87c85508712aa355b9c60531c67f08b /Types/BranchState.hs
parent8725fde5c66984d9769558a07612361b112be58f (diff)
Sped back up fsck, copy --from etc
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.
Diffstat (limited to 'Types/BranchState.hs')
-rw-r--r--Types/BranchState.hs11
1 files changed, 9 insertions, 2 deletions
diff --git a/Types/BranchState.hs b/Types/BranchState.hs
index 40d7f5c2c..bc1d32e69 100644
--- a/Types/BranchState.hs
+++ b/Types/BranchState.hs
@@ -7,11 +7,18 @@
module Types.BranchState where
+import System.IO
+
data BranchState = BranchState {
- branchUpdated :: Bool,
+ 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 ""
+startBranchState = BranchState False Nothing Nothing ""