From e9e89e3aa538298f77e98da01bc36416118e9e88 Mon Sep 17 00:00:00 2001 From: William Hesse Date: Sun, 3 Mar 2019 19:02:32 +0000 Subject: [PATCH] Improve error message for missing gerrit credentials in git-cl. Bug: Change-Id: I058fcd85548c6e17f33de71ed2ad04549294e13d R: dpranke@chromium.org, iannucci@chromium.org Reviewed-on: https://chromium-review.googlesource.com/c/558250 Reviewed-by: Robbie Iannucci Reviewed-by: Andrii Shyshkalov Commit-Queue: Andrii Shyshkalov --- gerrit_util.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gerrit_util.py b/gerrit_util.py index 1923b6ad5..baec860c5 100644 --- a/gerrit_util.py +++ b/gerrit_util.py @@ -140,6 +140,10 @@ class CookiesAuthenticator(Authenticator): @classmethod def get_new_password_message(cls, host): + if host is None: + return ('Git host for gerrit upload is unknown. Check your remote ' + 'and the branch your branch is tracking. This tool assumes ' + 'that you are using a git server at *.googlesource.com.') assert not host.startswith('http') # Assume *.googlesource.com pattern. parts = host.split('.')