All backends use genKeyName, which uses preSanitizeKeyName, which will
escape newlines.
I suspect this newline prevention was added back when git-annex was
reading the output of sha1sum..
Sponsored-by: Kevin Mueller on Patreon
case B.genKey b of
Just a -> do
k <- a source meterupdate
- return (makesane k, b)
+ return (k, b)
Nothing -> giveup $ "Cannot generate a key for backend " ++
decodeBS (formatKeyVariety (B.backendVariety b))
- where
- -- keyNames should not contain newline characters.
- makesane k = alterKey k $ \d -> d
- { keyName = S.toShort (S8.map fixbadchar (S.fromShort (fromKey keyName k)))
- }
- fixbadchar c
- | c == '\n' = '_'
- | otherwise = c
getBackend :: FilePath -> Key -> Annex (Maybe Backend)
getBackend file k = maybeLookupBackendVariety (fromKey keyVariety k) >>= \case