simplify and make more atomic
This commit is contained in:
parent
f8e700ed06
commit
0880c8319e
1 changed files with 2 additions and 4 deletions
|
@ -16,11 +16,9 @@ import qualified Annex
|
||||||
getState :: Annex BranchState
|
getState :: Annex BranchState
|
||||||
getState = 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 :: (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
|
{- Runs an action to check that the index file exists, if it's not been
|
||||||
- checked before in this run of git-annex. -}
|
- checked before in this run of git-annex. -}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue