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:
parent
9fc1448947
commit
ae341c1a37
1 changed files with 5 additions and 2 deletions
|
@ -36,10 +36,13 @@ isAnnexLink file = maybe Nothing (fileKey . takeFileName) <$> getAnnexLinkTarget
|
||||||
- content.
|
- content.
|
||||||
-}
|
-}
|
||||||
getAnnexLinkTarget :: FilePath -> Annex (Maybe LinkTarget)
|
getAnnexLinkTarget :: FilePath -> Annex (Maybe LinkTarget)
|
||||||
getAnnexLinkTarget file =
|
getAnnexLinkTarget file = ifM (coreSymlinks <$> Annex.getGitConfig)
|
||||||
check readSymbolicLink $
|
( check readSymbolicLink $
|
||||||
check readfilestart $
|
check readfilestart $
|
||||||
return Nothing
|
return Nothing
|
||||||
|
, check readSymbolicLink $
|
||||||
|
return Nothing
|
||||||
|
)
|
||||||
where
|
where
|
||||||
check getlinktarget fallback = do
|
check getlinktarget fallback = do
|
||||||
v <- liftIO $ catchMaybeIO $ getlinktarget file
|
v <- liftIO $ catchMaybeIO $ getlinktarget file
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue