diff options
Diffstat (limited to 'src/Storage.hs')
-rw-r--r-- | src/Storage.hs | 16 |
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' |