remove old and uncessary sanity check
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
This commit is contained in:
parent
19e78816f0
commit
f2846d803c
1 changed files with 1 additions and 9 deletions
10
Backend.hs
10
Backend.hs
|
@ -62,17 +62,9 @@ genKey source meterupdate preferredbackend = do
|
||||||
case B.genKey b of
|
case B.genKey b of
|
||||||
Just a -> do
|
Just a -> do
|
||||||
k <- a source meterupdate
|
k <- a source meterupdate
|
||||||
return (makesane k, b)
|
return (k, b)
|
||||||
Nothing -> giveup $ "Cannot generate a key for backend " ++
|
Nothing -> giveup $ "Cannot generate a key for backend " ++
|
||||||
decodeBS (formatKeyVariety (B.backendVariety b))
|
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 :: FilePath -> Key -> Annex (Maybe Backend)
|
||||||
getBackend file k = maybeLookupBackendVariety (fromKey keyVariety k) >>= \case
|
getBackend file k = maybeLookupBackendVariety (fromKey keyVariety k) >>= \case
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue