From 0d14d0d85b8f4899b19dfe499c3af68b96a1ee08 Mon Sep 17 00:00:00 2001 From: erikchen Date: Tue, 28 Aug 2018 18:57:09 +0000 Subject: [PATCH] "git cl patch" should ignore trailing "/" from remote url. This causes git cl patch to unnecessarily fail for the build repo. e.g. """ Trying to patch a change from https://chromium.googlesource.com/chromium/tools/build but this repo appears to be https://chromium.googlesource.com/chromium/tools/build/. """ Change-Id: I91d6ab1325bb88c001c20c20007c30e111ab8f64 Reviewed-on: https://chromium-review.googlesource.com/1194485 Reviewed-by: Andrii Shyshkalov Commit-Queue: Erik Chen --- git_cl.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/git_cl.py b/git_cl.py index 3eebd2624..b92cae18c 100755 --- a/git_cl.py +++ b/git_cl.py @@ -2832,7 +2832,10 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase): remote_url = self._changelist.GetRemoteUrl() if remote_url.endswith('.git'): remote_url = remote_url[:-len('.git')] + remote_url = remote_url.rstrip('/') + fetch_info = revision_info['fetch']['http'] + fetch_info['url'] = fetch_info['url'].rstrip('/') if remote_url != fetch_info['url']: DieWithError('Trying to patch a change from %s but this repo appears '