summaryrefslogtreecommitdiff
path: root/src/Storage.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Storage.hs')
-rw-r--r--src/Storage.hs16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/Storage.hs b/src/Storage.hs
index 84df213..cc2476f 100644
--- a/src/Storage.hs
+++ b/src/Storage.hs
@@ -115,13 +115,25 @@ openStorage path = do
createDirectoryIfMissing True $ path ++ "/heads"
watchers <- newMVar ([], WatchList 1 [])
refgen <- newMVar =<< HT.new
- return $ Storage { stBacking = StorageDir path watchers, stParent = Nothing, stRefGeneration = refgen }
+ refroots <- newMVar =<< HT.new
+ return $ Storage
+ { stBacking = StorageDir path watchers
+ , stParent = Nothing
+ , stRefGeneration = refgen
+ , stRefRoots = refroots
+ }
memoryStorage' :: IO (Storage' c')
memoryStorage' = do
backing <- StorageMemory <$> newMVar [] <*> newMVar M.empty <*> newMVar M.empty <*> newMVar (WatchList 1 [])
refgen <- newMVar =<< HT.new
- return $ Storage { stBacking = backing, stParent = Nothing, stRefGeneration = refgen }
+ refroots <- newMVar =<< HT.new
+ return $ Storage
+ { stBacking = backing
+ , stParent = Nothing
+ , stRefGeneration = refgen
+ , stRefRoots = refroots
+ }
memoryStorage :: IO Storage
memoryStorage = memoryStorage'