From 8cb9381befed4174624edfc80e09185c9340b4f6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 10 Mar 2017 13:12:24 -0400 Subject: AssociatedFile newtype To prevent any further mistakes like 1a497cefb47557f0b4788c606f9071be422b2511 This commit was sponsored by Francois Marier on Patreon. --- Remote/GCrypt.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Remote/GCrypt.hs') diff --git a/Remote/GCrypt.hs b/Remote/GCrypt.hs index 79020f40c..ea101a770 100644 --- a/Remote/GCrypt.hs +++ b/Remote/GCrypt.hs @@ -326,7 +326,8 @@ store r rsyncopts return True | Git.repoIsSsh (repo r) = if accessShell r then fileStorer $ \k f p -> Ssh.rsyncHelper (Just p) - =<< Ssh.rsyncParamsRemote False r Upload k f Nothing + =<< Ssh.rsyncParamsRemote False r Upload k f + (AssociatedFile Nothing) else fileStorer $ Remote.Rsync.store rsyncopts | otherwise = unsupportedUrl @@ -336,8 +337,10 @@ retrieve r rsyncopts guardUsable (repo r) (return False) $ sink =<< liftIO (L.readFile $ gCryptLocation r k) | Git.repoIsSsh (repo r) = if accessShell r - then fileRetriever $ \f k p -> - unlessM (Ssh.rsyncHelper (Just p) =<< Ssh.rsyncParamsRemote False r Download k f Nothing) $ + then fileRetriever $ \f k p -> do + ps <- Ssh.rsyncParamsRemote False r Download k f + (AssociatedFile Nothing) + unlessM (Ssh.rsyncHelper (Just p) ps) $ giveup "rsync failed" else fileRetriever $ Remote.Rsync.retrieve rsyncopts | otherwise = unsupportedUrl -- cgit v1.2.3