aboutsummaryrefslogtreecommitdiff
path: root/Annex/Link.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-07-20 19:14:29 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-07-20 19:14:29 -0400
commit08034d294434c2ed0c90e7c11d2139694d7cdd70 (patch)
tree12b3098e2cbd6697f998c1d72a00617e957b8647 /Annex/Link.hs
parent5b3ca1777c93daccc4212ed03c658db54b17b747 (diff)
avoid reading files that are not symlinks when core.symlinks=false
This hack is only needed on FAT filesystems, so there's no point in doing it the rest of the time. And it's possible for there to be a false positive, so it's best to avoid the hack when possible.
Diffstat (limited to 'Annex/Link.hs')
-rw-r--r--Annex/Link.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/Annex/Link.hs b/Annex/Link.hs
index 72c84c0c8..eeae16f15 100644
--- a/Annex/Link.hs
+++ b/Annex/Link.hs
@@ -36,10 +36,13 @@ isAnnexLink file = maybe Nothing (fileKey . takeFileName) <$> getAnnexLinkTarget
- content.
-}
getAnnexLinkTarget :: FilePath -> Annex (Maybe LinkTarget)
-getAnnexLinkTarget file =
- check readSymbolicLink $
+getAnnexLinkTarget file = ifM (coreSymlinks <$> Annex.getGitConfig)
+ ( check readSymbolicLink $
check readfilestart $
return Nothing
+ , check readSymbolicLink $
+ return Nothing
+ )
where
check getlinktarget fallback = do
v <- liftIO $ catchMaybeIO $ getlinktarget file