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.
This commit is contained in:
parent
32dcc1303a
commit
adc27f081a
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue