"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 <tandrii@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
changes/85/1194485/4
erikchen 7 years ago committed by Commit Bot
parent bc56d8cfab
commit 0d14d0d85b

@ -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 '

Loading…
Cancel
Save