From 3f5f28b48754bc91620a6354ca70afe4c61c9894 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 9 Dec 2011 12:23:45 -0400 Subject: factor out a stopUnless code melt for lunch --- Command/Move.hs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'Command/Move.hs') diff --git a/Command/Move.hs b/Command/Move.hs index fd1ed9019..cc26eecda 100644 --- a/Command/Move.hs +++ b/Command/Move.hs @@ -108,17 +108,11 @@ toPerform dest move key = moveLock move key $ do fromStart :: Remote.Remote Annex -> Bool -> FilePath -> Key -> CommandStart fromStart src move file key | move = go - | otherwise = do - ishere <- inAnnex key - if ishere then stop else go + | otherwise = stopUnless (inAnnex key) go where - go = do - ok <- fromOk src key - if ok - then do - showMoveAction move file - next $ fromPerform src move key - else stop + go = stopUnless (fromOk src key) $ do + showMoveAction move file + next $ fromPerform src move key fromOk :: Remote.Remote Annex -> Key -> Annex Bool fromOk src key = do u <- getUUID -- cgit v1.2.3