summaryrefslogtreecommitdiff
path: root/Locations.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-11-28 23:20:31 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-11-28 23:20:31 -0400
commitbff6ca2634e5f796d83c1632a66ac00adab0be43 (patch)
tree64ad9d1001357266e2e6a8b516703f0c603f2582 /Locations.hs
parente6ef66cea39b8c97a1e5115251e5ed0163c66fb3 (diff)
refactor
Diffstat (limited to 'Locations.hs')
-rw-r--r--Locations.hs11
1 files changed, 10 insertions, 1 deletions
diff --git a/Locations.hs b/Locations.hs
index a7a1f0cd1..53a80043a 100644
--- a/Locations.hs
+++ b/Locations.hs
@@ -20,6 +20,7 @@ module Locations (
gitAnnexJournalDir,
gitAnnexJournalLock,
isLinkToAnnex,
+ annexHashes,
hashDirMixed,
hashDirLower,
@@ -58,10 +59,18 @@ annexDir = addTrailingPathSeparator "annex"
objectDir :: FilePath
objectDir = addTrailingPathSeparator $ annexDir </> "objects"
+{- 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),
+ - which do not allow using a directory "XX" when "xx" already exists.
+ - To support that, some repositories will use a lower case hash. -}
+annexHashes :: [Key -> FilePath]
+annexHashes = [hashDirMixed, hashDirLower]
+
{- Annexed file's possible locations relative to the .git directory.
- There are two different possibilities, using different hashes. -}
annexLocations :: Key -> [FilePath]
-annexLocations key = map (annexLocation key) [hashDirMixed, hashDirLower]
+annexLocations key = map (annexLocation key) annexHashes
annexLocation :: Key -> (Key -> FilePath) -> FilePath
annexLocation key hasher = objectDir </> hasher key </> f </> f
where