summaryrefslogtreecommitdiff
path: root/main/Main.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2026-08-15 23:11:25 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2026-08-15 23:12:45 +0200
commitd1ae298161660e5fd2ac9a0dcbc3c3b3305a05e5 (patch)
treec5016468984be16c65a373c3b54c03a28e0d30ba /main/Main.hs
parent03c1f809b23d5ab1613ce5633acc9706469587c1 (diff)
Track local head cache in main/test commandsHEADmaster
Diffstat (limited to 'main/Main.hs')
-rw-r--r--main/Main.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/main/Main.hs b/main/Main.hs
index 654c04b..5d5df63 100644
--- a/main/Main.hs
+++ b/main/Main.hs
@@ -51,6 +51,7 @@ import Erebos.Set
import Erebos.State
import Erebos.Storable
import Erebos.Storage
+import Erebos.Storage.Head
import Erebos.Storage.Merge
import Erebos.Sync
import Erebos.TextFormat
@@ -635,6 +636,11 @@ instance MonadHead LocalState CommandM where
modify $ \s -> s { csHead = h' }
return x
+ getLocalHeadCache _ = do
+ h <- maybe (fail "failed to reload head") return =<< reloadHead =<< gets csHead
+ modify $ \s -> s { csHead = h }
+ return $ headCache h
+
type Command = CommandM ()
getSelectedPeer :: CommandM Peer