diff options
author | Joey Hess <joey@kitenet.net> | 2011-11-18 17:09:10 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-11-18 17:26:37 -0400 |
commit | 1b90918cec5a649d490a56d6fc8417ca623cbb6a (patch) | |
tree | 87c44f3700d811ffee23e3154c145c9d1f9945ea /Command/Move.hs | |
parent | c50a5fbeb4f90041f16cc84bf6b39577655d42b6 (diff) |
avoid error message when doing get --from on file not present on remote
Diffstat (limited to 'Command/Move.hs')
-rw-r--r-- | Command/Move.hs | 14 |
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 |