summaryrefslogtreecommitdiff
path: root/Annex/DirHashes.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Annex/DirHashes.hs')
-rw-r--r--Annex/DirHashes.hs16
1 files changed, 13 insertions, 3 deletions
diff --git a/Annex/DirHashes.hs b/Annex/DirHashes.hs
index 36998821b..b58b5a215 100644
--- a/Annex/DirHashes.hs
+++ b/Annex/DirHashes.hs
@@ -9,6 +9,8 @@ module Annex.DirHashes (
Hasher,
HashLevels(..),
objectHashLevels,
+ branchHashLevels,
+ branchHashDir,
dirHashes,
hashDirMixed,
hashDirLower,
@@ -33,11 +35,19 @@ instance Default HashLevels where
def = HashLevels 2
objectHashLevels :: GitConfig -> HashLevels
-objectHashLevels config
- | hasDifference (== OneLevelObjectHash) (annexDifferences config) =
- HashLevels 1
+objectHashLevels = configHashLevels OneLevelObjectHash
+
+branchHashLevels :: GitConfig -> HashLevels
+branchHashLevels = configHashLevels OneLevelBranchHash
+
+configHashLevels :: Difference -> GitConfig -> HashLevels
+configHashLevels d config
+ | hasDifference (== d) (annexDifferences config) = HashLevels 1
| otherwise = def
+branchHashDir :: GitConfig -> Key -> String
+branchHashDir config key = hashDirLower (branchHashLevels config) key
+
{- Two different directory hashes may be used. The mixed case hash
- came first, and is fine, except for the problem of case-strict
- filesystems such as Linux VFAT (mounted with shortname=mixed),