Allow retrieving of non-standard git URIs

Non-standard git URIs are ones that do not start with 'git:' nor end
with '.git'. An example of non-standard git URI is
'ssh://server/home/user/repo'.

The mechanism for specifying a non-standard git URI is done by
prefixing the whole URI with 'git:' to signify that it should be
handled with the git resolver. For example, non-standard git URIs like
'git:ssh://server/user/repo' and 'git:https://server/user/repo' can
now be used.
This commit is contained in:
Sanjin Sehic 2011-12-19 11:25:30 +01:00 committed by Mark Harrah
parent 77626f5232
commit 972acc871a
3 changed files with 17 additions and 2 deletions

View File

@ -57,7 +57,9 @@ object RetrieveUnit
object Path
{
def unapply(uri: URI) = Option(uri.getPath)
import RichURI.fromURI
def unapply(uri: URI) = Option(uri.withoutMarkerScheme.getPath)
}
}
object EvaluateConfigurations

View File

@ -63,7 +63,7 @@ object Resolvers
}
}
val uri = info.uri
val uri = info.uri.withoutMarkerScheme
val staging = info.staging
Some {
() =>

View File

@ -20,6 +20,19 @@ class RichURI(uri: URI)
new URI(uri.getScheme, uri.getSchemeSpecificPart, null)
else
uri
def hasMarkerScheme = new URI(uri.getSchemeSpecificPart).getScheme ne null
def withoutMarkerScheme =
{
if (hasMarkerScheme)
if (hasFragment)
new URI(uri.getSchemeSpecificPart + "#" + uri.getFragment)
else
new URI(uri.getSchemeSpecificPart)
else
uri
}
}
object RichURI