summaryrefslogtreecommitdiff
path: root/Remote
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-01-28 16:51:40 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-01-28 16:52:08 -0400
commit6e765717650f0270cdc497d38245bcbc4180e60c (patch)
treec989f13da5507d8f46fdfa1b36f1ce0aa77aca2f /Remote
parent82161654830b0dc4187e9928555c9321ef61bb89 (diff)
implement annex.tune.objecthashlower
Split out Annex.DirHashes which never really belonged in Locations.
Diffstat (limited to 'Remote')
-rw-r--r--Remote/Git.hs6
-rw-r--r--Remote/Rsync.hs3
-rw-r--r--Remote/Rsync/RsyncUrl.hs3
3 files changed, 8 insertions, 4 deletions
diff --git a/Remote/Git.hs b/Remote/Git.hs
index b31a1d850..328e39111 100644
--- a/Remote/Git.hs
+++ b/Remote/Git.hs
@@ -327,13 +327,15 @@ keyUrls r key = map tourl locs'
-- If the remote is known to not be bare, try the hash locations
-- used for non-bare repos first, as an optimisation.
locs
- | remoteAnnexBare (gitconfig r) == Just False = reverse (annexLocations key)
- | otherwise = annexLocations key
+ | remoteAnnexBare remoteconfig == Just False = reverse (annexLocations cfg key)
+ | otherwise = annexLocations cfg key
#ifndef mingw32_HOST_OS
locs' = locs
#else
locs' = map (replace "\\" "/") locs
#endif
+ remoteconfig = gitconfig r
+ cfg = fromJust $ remoteGitConfig remoteconfig
dropKey :: Remote -> Key -> Annex Bool
dropKey r key
diff --git a/Remote/Rsync.hs b/Remote/Rsync.hs
index 04bbb19a7..da258551b 100644
--- a/Remote/Rsync.hs
+++ b/Remote/Rsync.hs
@@ -37,6 +37,7 @@ import Annex.Perms
import Logs.Transfer
import Types.Creds
import Types.Key (isChunkKey)
+import Annex.DirHashes
import qualified Data.Map as M
@@ -212,7 +213,7 @@ remove o k = do
- content could be. Note that the parent directories have
- to also be explicitly included, due to how rsync
- traverses directories. -}
- includes = concatMap use (annexHashes def)
+ includes = concatMap (use .def) dirHashes
use h = let dir = h k in
[ parentDir dir
, dir
diff --git a/Remote/Rsync/RsyncUrl.hs b/Remote/Rsync/RsyncUrl.hs
index 5493e4e90..0cb1733c6 100644
--- a/Remote/Rsync/RsyncUrl.hs
+++ b/Remote/Rsync/RsyncUrl.hs
@@ -19,6 +19,7 @@ import System.FilePath.Posix
#ifdef mingw32_HOST_OS
import Data.String.Utils
#endif
+import Annex.DirHashes
type RsyncUrl = String
@@ -36,7 +37,7 @@ rsyncEscape o u
| otherwise = u
rsyncUrls :: RsyncOpts -> Key -> [RsyncUrl]
-rsyncUrls o k = map use (annexHashes def)
+rsyncUrls o k = map (use . def) dirHashes
where
use h = rsyncUrl o </> hash h </> rsyncEscape o (f </> f)
f = keyFile k