back to annex:: for git-remote-annex url

Oh, turns out git needs two colons to use a gitremote-helper. Ok.
This commit is contained in:
Joey Hess 2024-05-07 14:37:29 -04:00
parent e1447dc2e2
commit 947cf1c345
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 11 additions and 15 deletions

View file

@ -135,18 +135,18 @@ data SpecialRemoteConfig = SpecialRemoteConfig
deriving (Show)
-- The url for a special remote looks like
-- annex:uuid?param=value&param=value...
-- annex::uuid?param=value&param=value...
parseSpecialRemoteUrl :: String -> Either String SpecialRemoteConfig
parseSpecialRemoteUrl s = case parseURI s of
Nothing -> Left "URL parse failed"
Just u -> case uriScheme u of
"annex:" -> case uriPath u of
"" -> Left "annex: URL did not include a UUID"
(':':_) -> Left "annex: URL malformed"
p -> Right $ SpecialRemoteConfig
(':':p) -> Right $ SpecialRemoteConfig
{ specialRemoteUUID = toUUID p
, specialRemoteParams = parsequery u
}
_ -> Left "annex: URL malformed"
_ -> Left "Not an annex: URL"
where
parsequery u = map parsekv $ splitc '&' (drop 1 (uriQuery u))