aboutsummaryrefslogtreecommitdiff
path: root/Annex/Link.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-02-16 14:10:08 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-02-16 14:10:08 -0400
commit3776dee0a33fe3fe0cd1aceb14b5c2d0511d6c05 (patch)
tree5f913fe325cc00bd19095add9ba1c9cd48789618 /Annex/Link.hs
parentbe554edef8b42e5f357673ebb495dade79fc8be8 (diff)
escape slashes in annex pointer files
The problem with having the slashes unescaped is, it broke parsing, since the parser takes the filename to get the part containing the key. That particularly affected URL keys. This makes the format be the same as symlinks point to, which keeps things simple. Existing pointer files will continue to work ok.
Diffstat (limited to 'Annex/Link.hs')
-rw-r--r--Annex/Link.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Annex/Link.hs b/Annex/Link.hs
index 739ada76c..f10cca5c8 100644
--- a/Annex/Link.hs
+++ b/Annex/Link.hs
@@ -147,7 +147,7 @@ parseLinkOrPointer' :: String -> Maybe Key
parseLinkOrPointer' = go . fromInternalGitPath . takeWhile (not . lineend)
where
go l
- | isLinkToAnnex l = file2key $ takeFileName l
+ | isLinkToAnnex l = fileKey $ takeFileName l
| otherwise = Nothing
lineend '\n' = True
lineend '\r' = True
@@ -155,7 +155,7 @@ parseLinkOrPointer' = go . fromInternalGitPath . takeWhile (not . lineend)
formatPointer :: Key -> String
formatPointer k =
- toInternalGitPath (pathSeparator:objectDir </> key2file k) ++ "\n"
+ toInternalGitPath (pathSeparator:objectDir </> keyFile k) ++ "\n"
{- Checks if a file is a pointer to a key. -}
isPointerFile :: FilePath -> IO (Maybe Key)