diff options
| author | Roman Smrž <roman.smrz@seznam.cz> | 2026-08-02 22:22:15 +0200 |
|---|---|---|
| committer | Roman Smrž <roman.smrz@seznam.cz> | 2026-08-05 20:35:54 +0200 |
| commit | 0efd90e5f01996ceb01f5a2889f9e2986322c371 (patch) | |
| tree | 329aef1383154d7b2eeb2deca1f3522058284d83 /main/Test.hs | |
| parent | 9fe388f9172717cf0ebfd223e122506725a31542 (diff) | |
Diffstat (limited to 'main/Test.hs')
| -rw-r--r-- | main/Test.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/main/Test.hs b/main/Test.hs index 1755031..9038083 100644 --- a/main/Test.hs +++ b/main/Test.hs @@ -282,8 +282,10 @@ instance MonadStorage CommandM where instance MonadHead LocalState CommandM where updateLocalHead f = do - Just h <- gets tsHead - (Just h', x) <- maybe (fail "failed to reload head") (flip updateHead f) =<< reloadHead h + h <- maybe (fail "failed to reload head") return =<< reloadHead =<< getOrLoadHead + ( Just h', x ) <- updateHead' h $ \h' -> do + modify $ \s -> s { tsHead = Just h' } + f (headStoredObject h') modify $ \s -> s { tsHead = Just h' } return x |