summaryrefslogtreecommitdiff
path: root/Git/Branch.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-03-16 01:59:07 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-03-16 01:59:07 -0400
commit184a69171d5d983ee2f08cce28011d235f44cc5c (patch)
treeff85fc620618b55c8cbed0d8c99212e73004f5b5 /Git/Branch.hs
parentc0c9991c9f5322aef05f4c97d2c3f3bdc3101e46 (diff)
removed another 10 lines via ifM
Diffstat (limited to 'Git/Branch.hs')
-rw-r--r--Git/Branch.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/Git/Branch.hs b/Git/Branch.hs
index cd9188228..6edc1c306 100644
--- a/Git/Branch.hs
+++ b/Git/Branch.hs
@@ -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