summaryrefslogtreecommitdiff
path: root/Locations.hs
diff options
context:
space:
mode:
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