From 16d08f04e30ef3f45ce89ba33ce96972cbf743ef Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Wed, 20 Jul 2022 18:18:50 +0000 Subject: [PATCH] git-cl: parse baseurl arguments eagerly Currently, `git cl help baseurl` fails as it tries to execute the subcommand, completely bypassing the help. Parse the arguments early so that the help command runs cleanly for baseurl. Fixed: 1345909 Change-Id: Icad7aca6cdc7c9938e91a421cb72e08433a30fd4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3776942 Auto-Submit: Thiago Perrotta Reviewed-by: Gavin Mak Commit-Queue: Gavin Mak --- git_cl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git_cl.py b/git_cl.py index 9be92158e..7a5f66736 100755 --- a/git_cl.py +++ b/git_cl.py @@ -3391,9 +3391,9 @@ def CMDcreds_check(parser, args): @metrics.collector.collect_metrics('git cl baseurl') def CMDbaseurl(parser, args): """Gets or sets base-url for this branch.""" + _, args = parser.parse_args(args) branchref = scm.GIT.GetBranchRef(settings.GetRoot()) branch = scm.GIT.ShortBranchName(branchref) - _, args = parser.parse_args(args) if not args: print('Current base-url:') return RunGit(['config', 'branch.%s.base-url' % branch],