aboutsummaryrefslogtreecommitdiff
path: root/Annex/BranchState.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-04-10 15:16:17 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-04-10 15:16:17 -0400
commit46006fd6e5874939e491b12ef978901d8e1aae84 (patch)
tree493f27ed0dd68855d2247ea1993ebcec2abda112 /Annex/BranchState.hs
parent112ca28651e4e799ffe0d61933746f7f208dd140 (diff)
simplify and make more atomic
Diffstat (limited to 'Annex/BranchState.hs')
-rw-r--r--Annex/BranchState.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/Annex/BranchState.hs b/Annex/BranchState.hs
index 889a936b9..2885582cd 100644
--- a/Annex/BranchState.hs
+++ b/Annex/BranchState.hs
@@ -16,11 +16,9 @@ import qualified Annex
getState :: Annex BranchState
getState = Annex.getState Annex.branchstate
-setState :: BranchState -> Annex ()
-setState state = Annex.changeState $ \s -> s { Annex.branchstate = state }
-
changeState :: (BranchState -> BranchState) -> Annex ()
-changeState changer = setState =<< changer <$> getState
+changeState changer = Annex.changeState $ \s ->
+ s { Annex.branchstate = changer (Annex.branchstate s) }
{- Runs an action to check that the index file exists, if it's not been
- checked before in this run of git-annex. -}