summaryrefslogtreecommitdiff
path: root/Remote/Rsync.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-22 13:48:50 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-22 14:30:43 -0400
commit4ec9244f1af85b95d014103d93de913026b20fe3 (patch)
treec2ca5dbdc4817f1078b76cd445a4fa69531e905c /Remote/Rsync.hs
parente4592649d68535ad45fe37449a90427e84734359 (diff)
add a path field to remotes
Also broke out some helper functions around constructing remotes, to be used later.
Diffstat (limited to 'Remote/Rsync.hs')
-rw-r--r--Remote/Rsync.hs33
1 files changed, 18 insertions, 15 deletions
diff --git a/Remote/Rsync.hs b/Remote/Rsync.hs
index ee516a8a5..1ed73e119 100644
--- a/Remote/Rsync.hs
+++ b/Remote/Rsync.hs
@@ -45,21 +45,24 @@ gen r u c = do
return $ encryptableRemote c
(storeEncrypted o)
(retrieveEncrypted o)
- Remote {
- uuid = u,
- cost = cst,
- name = Git.repoDescribe r,
- storeKey = store o,
- retrieveKeyFile = retrieve o,
- retrieveKeyFileCheap = retrieveCheap o,
- removeKey = remove o,
- hasKey = checkPresent r o,
- hasKeyCheap = False,
- whereisKey = Nothing,
- config = Nothing,
- repo = r,
- remotetype = remote
- }
+ Remote
+ { uuid = u
+ , cost = cst
+ , name = Git.repoDescribe r
+ , storeKey = store o
+ , retrieveKeyFile = retrieve o
+ , retrieveKeyFileCheap = retrieveCheap o
+ , removeKey = remove o
+ , hasKey = checkPresent r o
+ , hasKeyCheap = False
+ , whereisKey = Nothing
+ , config = Nothing
+ , repo = r
+ , path = if rsyncUrlIsPath $ rsyncUrl o
+ then Just $ rsyncUrl o
+ else Nothing
+ , remotetype = remote
+ }
genRsyncOpts :: Git.Repo -> Maybe RemoteConfig -> Annex RsyncOpts
genRsyncOpts r c = do