Fix transferring files to special remotes in direct mode.

This commit is contained in:
Joey Hess 2013-01-06 14:29:01 -04:00
parent e457be7631
commit 909f67443f
10 changed files with 33 additions and 38 deletions

View file

@ -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