From e1111f5710acf16d91975a9ee5e2c9464730becf Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 14 Mar 2020 16:28:31 -0400 Subject: [PATCH] launcher: init: stop passing --repo-url/--repo-branch down When the launcher handles the init subcommand, it takes care of setting the repo url & branch itself when cloning. So we don't need to pass them down to the checked out init subcommand. Further, the init subcommand has never actually done anything with those options, so there's no point in passing them. We'll be changing the latter behavior so that init will reset the url/branch when specified with an existing repo checkout which means passing them through adds overhead: the launcher will checkout to the right value, then chain to the sub-init which will then reset the checkout to the same value. Bug: https://crbug.com/gerrit/11045 Change-Id: Ia2a4ab9d86febc470aea4abd73d75bb10e848b56 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/259312 Tested-by: Mike Frysinger Reviewed-by: David Pursehouse --- repo | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/repo b/repo index 18694c5..c6a56c6 100755 --- a/repo +++ b/repo @@ -251,8 +251,6 @@ else: home_dot_repo = os.path.expanduser('~/.repoconfig') gpg_dir = os.path.join(home_dot_repo, 'gnupg') -extra_args = [] - def GetParser(gitc_init=False): """Setup the CLI parser.""" @@ -474,15 +472,8 @@ def _Init(args, gitc_init=False): opt.quiet = opt.output_mode is False opt.verbose = opt.output_mode is True - url = opt.repo_url - if not url: - url = REPO_URL - extra_args.append('--repo-url=%s' % url) - - branch = opt.repo_branch - if not branch: - branch = REPO_REV - extra_args.append('--repo-branch=%s' % branch) + url = opt.repo_url or REPO_URL + branch = opt.repo_branch or REPO_REV if branch.startswith('refs/heads/'): branch = branch[len('refs/heads/'):] @@ -1105,7 +1096,6 @@ def main(orig_args): '--wrapper-path=%s' % wrapper_path, '--'] me.extend(orig_args) - me.extend(extra_args) exec_command(me) print("fatal: unable to start %s" % repo_main, file=sys.stderr) sys.exit(148)