summaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
Diffstat (limited to 'Annex')
-rw-r--r--Annex/Link.hs12
1 files changed, 8 insertions, 4 deletions
diff --git a/Annex/Link.hs b/Annex/Link.hs
index 25166bff5..e50b97447 100644
--- a/Annex/Link.hs
+++ b/Annex/Link.hs
@@ -35,13 +35,17 @@ isAnnexLink file = maybe Nothing (fileKey . takeFileName) <$> getAnnexLinkTarget
- content.
-}
getAnnexLinkTarget :: FilePath -> Annex (Maybe LinkTarget)
-getAnnexLinkTarget file = ifM (coreSymlinks <$> Annex.getGitConfig)
- ( check readSymbolicLink $
+getAnnexLinkTarget f = getAnnexLinkTarget' f
+ =<< (coreSymlinks <$> Annex.getGitConfig)
+
+{- Pass False to force looking inside file. -}
+getAnnexLinkTarget' :: FilePath -> Bool -> Annex (Maybe LinkTarget)
+getAnnexLinkTarget' file coresymlinks = if coresymlinks
+ then check readSymbolicLink $
return Nothing
- , check readSymbolicLink $
+ else check readSymbolicLink $
check probefilecontent $
return Nothing
- )
where
check getlinktarget fallback = do
v <- liftIO $ catchMaybeIO $ getlinktarget file