summaryrefslogtreecommitdiff
path: root/Command/Move.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-12-09 12:23:45 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-12-09 12:23:45 -0400
commit3f5f28b48754bc91620a6354ca70afe4c61c9894 (patch)
tree6c71b52187f442ce619ffac7c672fc7f0b8f84ce /Command/Move.hs
parentd64132a43ae176e8a1353d5463c5387a93da9ad7 (diff)
factor out a stopUnless
code melt for lunch
Diffstat (limited to 'Command/Move.hs')
-rw-r--r--Command/Move.hs14
1 files changed, 4 insertions, 10 deletions
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