summaryrefslogtreecommitdiff
path: root/Command/Move.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/Move.hs')
-rw-r--r--Command/Move.hs14
1 files changed, 9 insertions, 5 deletions
diff --git a/Command/Move.hs b/Command/Move.hs
index 155f4d605..4c4534c49 100644
--- a/Command/Move.hs
+++ b/Command/Move.hs
@@ -117,13 +117,17 @@ fromStart src move file key
if ishere then stop else go
where
go = do
- u <- getUUID
- remotes <- Remote.keyPossibilities key
- if u == Remote.uuid src || not (any (== src) remotes)
- then stop
- else do
+ ok <- fromOk src key
+ if ok
+ then do
showMoveAction move file
next $ fromPerform src move key
+ else stop
+fromOk :: Remote.Remote Annex -> Key -> Annex Bool
+fromOk src key = do
+ u <- getUUID
+ remotes <- Remote.keyPossibilities key
+ return $ u /= Remote.uuid src && any (== src) remotes
fromPerform :: Remote.Remote Annex -> Bool -> Key -> CommandPerform
fromPerform src move key = moveLock move key $ do
ishere <- inAnnex key