summaryrefslogtreecommitdiff
path: root/Remote/Hook.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Remote/Hook.hs')
-rw-r--r--Remote/Hook.hs9
1 files changed, 4 insertions, 5 deletions
diff --git a/Remote/Hook.hs b/Remote/Hook.hs
index 8b6a6cecf..06568a3cb 100644
--- a/Remote/Hook.hs
+++ b/Remote/Hook.hs
@@ -98,14 +98,13 @@ runHook hooktype hook k f a = maybe (return False) run =<< lookupHook hooktype h
store :: String -> Key -> Annex Bool
store h k = do
- g <- gitRepo
- runHook h "store" k (Just $ gitAnnexLocation g k) $ return True
+ src <- fromRepo $ gitAnnexLocation k
+ runHook h "store" k (Just src) $ return True
storeEncrypted :: String -> (Cipher, Key) -> Key -> Annex Bool
storeEncrypted h (cipher, enck) k = withTmp enck $ \tmp -> do
- g <- gitRepo
- let f = gitAnnexLocation g k
- liftIO $ withEncryptedContent cipher (L.readFile f) $ \s -> L.writeFile tmp s
+ src <- fromRepo $ gitAnnexLocation k
+ liftIO $ withEncryptedContent cipher (L.readFile src) $ L.writeFile tmp
runHook h "store" enck (Just tmp) $ return True
retrieve :: String -> Key -> FilePath -> Annex Bool