summaryrefslogtreecommitdiff
path: root/Locations.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-06-11 15:14:42 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-06-11 15:15:05 -0400
commit0d30987f8780d51ea144f2fca9f6482b15c2b71d (patch)
treec58e9cd90566be449711eeaf76afca3fd9b4d022 /Locations.hs
parent40b52623536beb978d3bcc941b8a87a12010cbac (diff)
Fix bug that prevented enumerating locally present objects in repos tuned with annex.tune.objecthash1=true
Need to walk 1 level of subdirs less in this case. The git-annex branch traversal code didn't have a similar bug.
Diffstat (limited to 'Locations.hs')
-rw-r--r--Locations.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/Locations.hs b/Locations.hs
index 8b0b819e6..3076fc7cd 100644
--- a/Locations.hs
+++ b/Locations.hs
@@ -13,6 +13,7 @@ module Locations (
annexDir,
objectDir,
gitAnnexLocation,
+ gitAnnexLocationDepth,
gitAnnexLink,
gitAnnexContentLock,
gitAnnexMapping,
@@ -115,6 +116,13 @@ annexLocations config key = map (annexLocation config key) dirHashes
annexLocation :: GitConfig -> Key -> (HashLevels -> Hasher) -> FilePath
annexLocation config key hasher = objectDir </> keyPath key (hasher $ objectHashLevels config)
+{- Number of subdirectories from the gitAnnexObjectDir
+ - to the gitAnnexLocation. -}
+gitAnnexLocationDepth :: GitConfig -> Int
+gitAnnexLocationDepth config = hashlevels + 1
+ where
+ HashLevels hashlevels = objectHashLevels config
+
{- Annexed object's location in a repository.
-
- When there are multiple possible locations, returns the one where the