removed another 10 lines via ifM

This commit is contained in:
Joey Hess 2012-03-16 01:59:07 -04:00
parent c0c9991c9f
commit 184a69171d
9 changed files with 95 additions and 106 deletions

View file

@ -41,14 +41,14 @@ changed origbranch newbranch repo
-}
fastForward :: Branch -> [Ref] -> Repo -> IO Bool
fastForward _ [] _ = return True
fastForward branch (first:rest) repo = do
fastForward branch (first:rest) repo =
-- First, check that the branch does not contain any
-- new commits that are not in the first ref. If it does,
-- cannot fast-forward.
diverged <- changed first branch repo
if diverged
then no_ff
else maybe no_ff do_ff =<< findbest first rest
ifM (changed first branch repo)
( no_ff
, maybe no_ff do_ff =<< findbest first rest
)
where
no_ff = return False
do_ff to = do