avoid error message when doing get --from on file not present on remote

This commit is contained in:
Joey Hess 2011-11-18 17:09:10 -04:00
parent c50a5fbeb4
commit 1b90918cec
2 changed files with 18 additions and 8 deletions

View file

@ -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