remove old and uncessary sanity check
authorJoey Hess <joeyh@joeyh.name>
Wed, 6 Oct 2021 00:25:51 +0000 (20:25 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 6 Oct 2021 00:25:51 +0000 (20:25 -0400)
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
Backend.hs

index 3a00115368d81c598ab95514ba2b604654810604..1c6bc80e0657c86a2d47e80e90b936e4d0b06ddc 100644 (file)
@@ -62,17 +62,9 @@ genKey source meterupdate preferredbackend = do
        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