summaryrefslogtreecommitdiff
path: root/Remote/Rsync.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Remote/Rsync.hs')
-rw-r--r--Remote/Rsync.hs11
1 files changed, 2 insertions, 9 deletions
diff --git a/Remote/Rsync.hs b/Remote/Rsync.hs
index 3986863b3..b9cdc458e 100644
--- a/Remote/Rsync.hs
+++ b/Remote/Rsync.hs
@@ -39,6 +39,7 @@ import Logs.Transfer
import Types.Creds
import Types.Key (isChunkKey)
import Annex.DirHashes
+import Utility.Tmp
import qualified Data.Map as M
@@ -252,16 +253,8 @@ sendParams = ifM crippledFileSystem
- up trees for rsync. -}
withRsyncScratchDir :: (FilePath -> Annex a) -> Annex a
withRsyncScratchDir a = do
- p <- liftIO getPID
t <- fromRepo gitAnnexTmpObjectDir
- createAnnexDirectory t
- let tmp = t </> "rsynctmp" </> show p
- nuke tmp
- liftIO $ createDirectoryIfMissing True tmp
- nuke tmp `after` a tmp
- where
- nuke d = liftIO $ whenM (doesDirectoryExist d) $
- removeDirectoryRecursive d
+ withTmpDirIn t "rsynctmp" a
rsyncRetrieve :: RsyncOpts -> Key -> FilePath -> Maybe MeterUpdate -> Annex Bool
rsyncRetrieve o k dest meterupdate =