aboutsummaryrefslogtreecommitdiff
path: root/Remote/S3.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-01-06 14:29:01 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-01-06 14:29:01 -0400
commita6cd089cea9b2e6d12461f02ca7fbef9b12d403c (patch)
tree5a6ed63807b8b012f42f8f8f2ab6da5e5883d342 /Remote/S3.hs
parent3bac971ac22afd706d7ad52013c86a7dae80c684 (diff)
Fix transferring files to special remotes in direct mode.
Diffstat (limited to 'Remote/S3.hs')
-rw-r--r--Remote/S3.hs8
1 files changed, 3 insertions, 5 deletions
diff --git a/Remote/S3.hs b/Remote/S3.hs
index 0c0737841..7f1928608 100644
--- a/Remote/S3.hs
+++ b/Remote/S3.hs
@@ -112,8 +112,7 @@ s3Setup u c = handlehost $ M.lookup "host" c
M.delete "bucket" defaults
store :: Remote -> Key -> AssociatedFile -> MeterUpdate -> Annex Bool
-store r k _f p = s3Action r False $ \(conn, bucket) -> do
- src <- inRepo $ gitAnnexLocation k
+store r k _f p = s3Action r False $ \(conn, bucket) -> sendAnnex k $ \src -> do
res <- storeHelper (conn, bucket) r k p src
s3Bool res
@@ -121,9 +120,8 @@ storeEncrypted :: Remote -> (Cipher, Key) -> Key -> MeterUpdate -> Annex Bool
storeEncrypted r (cipher, enck) k p = s3Action r False $ \(conn, bucket) ->
-- To get file size of the encrypted content, have to use a temp file.
-- (An alternative would be chunking to to a constant size.)
- withTmp enck $ \tmp -> do
- f <- inRepo $ gitAnnexLocation k
- liftIO $ encrypt cipher (feedFile f) $
+ withTmp enck $ \tmp -> sendAnnex k $ \src -> do
+ liftIO $ encrypt cipher (feedFile src) $
readBytes $ L.writeFile tmp
res <- storeHelper (conn, bucket) r enck p tmp
s3Bool res