summaryrefslogtreecommitdiff
path: root/Locations.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-06-12 13:05:44 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-06-12 13:05:44 -0400
commit0ed41becb4c522bae16a0cff26caa36238d2e78a (patch)
tree6f9a2fcb44de3d3d022d40ad18c6aea327f61988 /Locations.hs
parent9f6e26857bceb987fa708d2ef4f251969d36c10e (diff)
optimise ObjectHashLower handling
A repo tuned with ObjectHashLower only ever uses lower-case hash directories, so unlike a bare repo which could have old mixed case directories, there is no need to do an expensive check of the filesystem in this case.
Diffstat (limited to 'Locations.hs')
-rw-r--r--Locations.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/Locations.hs b/Locations.hs
index 3076fc7cd..c3d9c7ab2 100644
--- a/Locations.hs
+++ b/Locations.hs
@@ -144,13 +144,11 @@ gitAnnexLocation' key r config crippled checker gitdir
- Repositories on filesystems that are crippled also use
- hashDirLower, since they do not use symlinks and it's
- more portable.
- -
- - ObjectHashLower can also be set to force it.
-}
- | Git.repoIsLocalBare r
- || crippled
- || hasDifference ObjectHashLower (annexDifferences config) =
- check $ map inrepo $ annexLocations config key
+ | Git.repoIsLocalBare r || crippled =
+ check $ map inrepo $ annexLocations config key
+ | hasDifference ObjectHashLower (annexDifferences config) =
+ return $ inrepo $ annexLocation config key hashDirLower
{- Non-bare repositories only use hashDirMixed, so
- don't need to do any work to check if the file is
- present. -}