summaryrefslogtreecommitdiff
path: root/Annex/Link.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Annex/Link.hs')
-rw-r--r--Annex/Link.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/Annex/Link.hs b/Annex/Link.hs
index 4a3311af9..82543257d 100644
--- a/Annex/Link.hs
+++ b/Annex/Link.hs
@@ -143,11 +143,14 @@ parseLinkOrPointer = parseLinkOrPointer' . decodeBS . L.take maxsz
maxsz = 81920
parseLinkOrPointer' :: String -> Maybe Key
-parseLinkOrPointer' s = headMaybe (lines (fromInternalGitPath s)) >>= go
+parseLinkOrPointer' = go . fromInternalGitPath . takeWhile (not . lineend)
where
go l
| isLinkToAnnex l = file2key $ takeFileName l
| otherwise = Nothing
+ lineend '\n' = True
+ lineend '\r' = True
+ lineend _ = False
formatPointer :: Key -> String
formatPointer k =