summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-01-09 18:42:29 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-01-09 18:42:29 -0400
commit0c893f8743bab81077e3ee0fed0993b746d7a269 (patch)
treeb3ddc0665c28fadbfac58fbc43fc8a9dc85f3956 /Command
parent680e6839ee42c754a58f8e57bf15a8063a16c6bb (diff)
Special remotes now all rollback storage of keys that get modified during the transfer, which can happen in direct mode.
Diffstat (limited to 'Command')
-rw-r--r--Command/SendKey.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Command/SendKey.hs b/Command/SendKey.hs
index 82c159f66..dfdec7f92 100644
--- a/Command/SendKey.hs
+++ b/Command/SendKey.hs
@@ -24,11 +24,16 @@ seek = [withKeys start]
start :: Key -> CommandStart
start key = ifM (inAnnex key)
( fieldTransfer Upload key $ \_p ->
- sendAnnex key $ liftIO . rsyncServerSend
+ sendAnnex key rollback $ liftIO . rsyncServerSend
, do
warning "requested key is not present"
liftIO exitFailure
)
+ where
+ {- No need to do any rollback; when sendAnnex fails, a nonzero
+ - exit will be propigated, and the remote will know the transfer
+ - failed. -}
+ rollback = noop
fieldTransfer :: Direction -> Key -> (MeterUpdate -> Annex Bool) -> CommandStart
fieldTransfer direction key a = do