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

@ -27,14 +27,20 @@ start numcopies file (key, _) = do
if inannex
then stop
else autoCopies key (<) numcopies $ do
showStart "get" file
from <- Annex.getState Annex.fromremote
case from of
Nothing -> next $ perform key
Nothing -> go $ perform key
Just name -> do
-- get --from = copy --from
src <- Remote.byName name
next $ Command.Move.fromPerform src False key
ok <- Command.Move.fromOk src key
if ok
then go $ Command.Move.fromPerform src False key
else stop
where
go a = do
showStart "get" file
next a
perform :: Key -> CommandPerform
perform key = do