From 0d30987f8780d51ea144f2fca9f6482b15c2b71d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Jun 2015 15:14:42 -0400 Subject: 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. --- Locations.hs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Locations.hs') 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 -- cgit v1.2.3