From f1631cd003fa148c44a84f92b3d0696b2aeae6a7 Mon Sep 17 00:00:00 2001 From: Dave Tu Date: Wed, 31 May 2017 16:35:16 -0700 Subject: [PATCH] [bot_update] Remove extraneous slash in revision parsing. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `parsed_root.path` already contains the leading slash in the the URL, so adding an additional slash gives an incorrect URL. Change-Id: I84f04179356bb132a31531232a5c30c7808f7c1b Reviewed-on: https://chromium-review.googlesource.com/520724 Reviewed-by: Paweł Hajdan Jr. Reviewed-by: Andrii Shyshkalov Commit-Queue: David Tu --- recipes/recipe_modules/bot_update/resources/bot_update.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/recipes/recipe_modules/bot_update/resources/bot_update.py b/recipes/recipe_modules/bot_update/resources/bot_update.py index e8e378877d..b835fd2d66 100755 --- a/recipes/recipe_modules/bot_update/resources/bot_update.py +++ b/recipes/recipe_modules/bot_update/resources/bot_update.py @@ -858,10 +858,9 @@ def parse_revisions(revisions, root): parsed_root = urlparse.urlparse(current_root) if parsed_root.scheme in ['http', 'https']: # We want to normalize git urls into .git urls. - normalized_root = 'https://%s/%s' % (parsed_root.netloc, - parsed_root.path) + normalized_root = 'https://' + parsed_root.netloc + parsed_root.path if not normalized_root.endswith('.git'): - normalized_root = '%s.git' % normalized_root + normalized_root += '.git' elif parsed_root.scheme: print 'WARNING: Unrecognized scheme %s, ignoring' % parsed_root.scheme continue