summaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-01-28 17:17:26 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-01-28 17:17:26 -0400
commit20a8350e36f6e38b55603e6578fa7b1c4967c1a9 (patch)
tree6c6b884cbc52496d614be996d702e0b8f6dc9300 /Annex
parent6e765717650f0270cdc497d38245bcbc4180e60c (diff)
implement annex.tune.branchhash1
I hope this doesn't impact speed much -- it does have to pull out a value from Annex state every time it accesses the branch now. The test case I dropped has never caught any problems that I can remember, and would have been rather difficult to convert.
Diffstat (limited to 'Annex')
-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),