summaryrefslogtreecommitdiff
path: root/Locations.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-12-02 14:56:48 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-12-02 14:56:48 -0400
commitdb5b479f3f9c68c05bd172b90fe5cab0336f378d (patch)
tree252778e16cccb12d4b58826e4f036a822ba5bdb4 /Locations.hs
parent0815cc2fc1ffccd89bb942a9129a2c29e291b038 (diff)
use lowercase hash by default; non-bare repos are a special case
Directory special remotes will now always store keys in the lowercase name, which avoids the complication of catching failures to create the mixed case name. Git remotes using http will now try the lowercase name first.
Diffstat (limited to 'Locations.hs')
-rw-r--r--Locations.hs8
1 files changed, 3 insertions, 5 deletions
diff --git a/Locations.hs b/Locations.hs
index 1b5f8108d..2f4a9200d 100644
--- a/Locations.hs
+++ b/Locations.hs
@@ -21,7 +21,6 @@ module Locations (
gitAnnexJournalDir,
gitAnnexJournalLock,
isLinkToAnnex,
- annexHashes,
hashDirMixed,
hashDirLower,
@@ -80,8 +79,7 @@ gitAnnexLocation key r
| Git.repoIsLocalBare r =
{- Bare repositories default to hashDirLower for new
- content, as it's more portable. -}
- go (Git.workTree r) $
- map (annexLocation key) [hashDirLower, hashDirMixed]
+ go (Git.workTree r) (annexLocations key)
| otherwise =
{- Non-bare repositories only use hashDirMixed, so
- don't need to do any work to check if the file is
@@ -189,10 +187,10 @@ prop_idempotent_fileKey s = Just k == fileKey (keyFile k)
- 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. -}
+ - To support that, most repositories use the lower case hash for new data. -}
type Hasher = Key -> FilePath
annexHashes :: [Hasher]
-annexHashes = [hashDirMixed, hashDirLower]
+annexHashes = [hashDirLower, hashDirMixed]
hashDirMixed :: Hasher
hashDirMixed k = addTrailingPathSeparator $ take 2 dir </> drop 2 dir