summaryrefslogtreecommitdiff
path: root/Remote/Hook.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/Hook.hs
parent3bac971ac22afd706d7ad52013c86a7dae80c684 (diff)
Fix transferring files to special remotes in direct mode.
Diffstat (limited to 'Remote/Hook.hs')
-rw-r--r--Remote/Hook.hs13
1 files changed, 6 insertions, 7 deletions
diff --git a/Remote/Hook.hs b/Remote/Hook.hs
index c9edda133..1b8c91d09 100644
--- a/Remote/Hook.hs
+++ b/Remote/Hook.hs
@@ -103,16 +103,15 @@ runHook hooktype hook k f a = maybe (return False) run =<< lookupHook hooktype h
)
store :: String -> Key -> AssociatedFile -> MeterUpdate -> Annex Bool
-store h k _f _p = do
- src <- inRepo $ gitAnnexLocation k
+store h k _f _p = sendAnnex k $ \src ->
runHook h "store" k (Just src) $ return True
storeEncrypted :: String -> (Cipher, Key) -> Key -> MeterUpdate -> Annex Bool
-storeEncrypted h (cipher, enck) k _p = withTmp enck $ \tmp -> do
- src <- inRepo $ gitAnnexLocation k
- liftIO $ encrypt cipher (feedFile src) $
- readBytes $ L.writeFile tmp
- runHook h "store" enck (Just tmp) $ return True
+storeEncrypted h (cipher, enck) k _p = withTmp enck $ \tmp ->
+ sendAnnex k $ \src -> do
+ liftIO $ encrypt cipher (feedFile src) $
+ readBytes $ L.writeFile tmp
+ runHook h "store" enck (Just tmp) $ return True
retrieve :: String -> Key -> AssociatedFile -> FilePath -> Annex Bool
retrieve h k _f d = runHook h "retrieve" k (Just d) $ return True