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.
This commit is contained in:
Joey Hess 2013-07-20 19:14:29 -04:00
parent 9fc1448947
commit ae341c1a37

View file

@ -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