mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
[git_cl] Add --global to creds-check
The UX of cd'ing to a non-Gerrit repo to setup common repo auth is not good. Also people don't read. Bug: 408501013 Change-Id: Ia31914cf8672d0b5a6033de11c928140fd34a95c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6442235 Reviewed-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Allen Li <ayatane@chromium.org>
This commit is contained in:
@@ -3900,7 +3900,12 @@ class _GitCookiesChecker(object):
|
||||
@metrics.collector.collect_metrics('git cl creds-check')
|
||||
def CMDcreds_check(parser, args):
|
||||
"""Checks credentials and suggests changes."""
|
||||
_, _ = parser.parse_args(args)
|
||||
parser.add_option(
|
||||
'--global',
|
||||
action='store_true',
|
||||
dest='force_global',
|
||||
help='Check global credentials instead of for the current repo.')
|
||||
options, args = parser.parse_args(args)
|
||||
|
||||
if newauth.SwitchedOn():
|
||||
cl = Changelist()
|
||||
@@ -3910,7 +3915,7 @@ def CMDcreds_check(parser, args):
|
||||
remote_url = ''
|
||||
wizard = git_auth.ConfigWizard(
|
||||
git_auth.UserInterface(sys.stdin, sys.stdout))
|
||||
wizard.run(remote_url)
|
||||
wizard.run(remote_url=remote_url, force_global=options.force_global)
|
||||
return 0
|
||||
if newauth.ExplicitlyDisabled():
|
||||
git_auth.ClearRepoConfig(os.getcwd(), Changelist())
|
||||
|
||||
Reference in New Issue
Block a user