don't treat foo::bar as a ssh url

It's a git-remote-helper location, and will be stored as just an url.
This commit is contained in:
Joey Hess 2012-11-09 13:50:23 -04:00
parent 82ccb385e3
commit 444e984727

View file

@ -159,7 +159,10 @@ fromRemoteLocation s repo = gen $ calcloc s
(prefix, suffix) = ("url." , ".insteadof")
urlstyle v = isURI v || ":" `isInfixOf` v && "//" `isInfixOf` v
-- git remotes can be written scp style -- [user@]host:dir
scpstyle v = ":" `isInfixOf` v && not ("//" `isInfixOf` v)
-- but foo::bar is a git-remote-helper location instead
scpstyle v = ":" `isInfixOf` v
&& not ("//" `isInfixOf` v)
&& not ("::" `isInfixOf` v)
scptourl v = "ssh://" ++ host ++ slash dir
where
(host, dir) = separate (== ':') v