gclient: fix bug where ssh urls with a username weren't parse correctly

ssh://test@example.org/test.git was not parsed correctly because we
would split at the '@' assuming what followed was a revision.

Review URL: http://codereview.chromium.org/372045

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@31444 0039d316-1c4b-4281-b951-d872f2087c98
experimental/szager/collated-output
msb@chromium.org 16 years ago
parent e1555a609d
commit 7780c28b92

@ -125,7 +125,12 @@ class GitWrapper(SCMWrapper):
if args:
raise gclient_utils.Error("Unsupported argument(s): %s" % ",".join(args))
components = self.url.split("@")
if self.url.startswith('ssh:'):
# Make sure ssh://test@example.com/test.git@stable works
regex = r"(ssh://(?:[\w]+@)?[-\w:\.]+/[-\w\.]+)(?:@([\w/]+))?"
components = re.search(regex, self.url).groups()
else:
components = self.url.split("@")
url = components[0]
revision = None
if options.revision:

Loading…
Cancel
Save