diff options
author | Joey Hess <joey@kitenet.net> | 2014-02-02 16:06:34 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-02-02 16:06:34 -0400 |
commit | a8fb1b684ef93c02b0741e18998e6b20d1d880f1 (patch) | |
tree | 057a31fd2f530b3a7e994f7c822721f42948adfb /Remote/Helper | |
parent | 04f31f98ee20f67214d579374b2e5a0f0a1659ec (diff) |
Added ways to configure rsync options to be used only when uploading or downloading from a remote. Useful to eg limit upload bandwidth.
Diffstat (limited to 'Remote/Helper')
-rw-r--r-- | Remote/Helper/Ssh.hs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Remote/Helper/Ssh.hs b/Remote/Helper/Ssh.hs index 964c8355a..8de88953f 100644 --- a/Remote/Helper/Ssh.hs +++ b/Remote/Helper/Ssh.hs @@ -122,7 +122,7 @@ rsyncParamsRemote direct r direction key file afile = do fields -- Convert the ssh command into rsync command line. let eparam = rsyncShell (Param shellcmd:shellparams) - let o = rsyncParams r + let o = rsyncParams r direction return $ if direction == Download then o ++ rsyncopts eparam dummy (File file) else o ++ rsyncopts eparam (File file) dummy @@ -140,7 +140,11 @@ rsyncParamsRemote direct r direction key file afile = do dummy = Param "dummy:" -- --inplace to resume partial files -rsyncParams :: Remote -> [CommandParam] -rsyncParams r = Params "--progress --inplace" : - map Param (remoteAnnexRsyncOptions $ gitconfig r) - +rsyncParams :: Remote -> Direction -> [CommandParam] +rsyncParams r direction = Params "--progress --inplace" : + map Param (remoteAnnexRsyncOptions gc ++ dps) + where + dps + | direction == Download = remoteAnnexRsyncDownloadOptions gc + | otherwise = remoteAnnexRsyncUploadOptions gc + gc = gitconfig r |