summaryrefslogtreecommitdiff
path: root/Command/Get.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/Get.hs')
-rw-r--r--Command/Get.hs12
1 files changed, 9 insertions, 3 deletions
diff --git a/Command/Get.hs b/Command/Get.hs
index f7d953bb6..093cd2cc5 100644
--- a/Command/Get.hs
+++ b/Command/Get.hs
@@ -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