From d75ca2eb9d83014caa4278c9aaabe94a0b5a67f7 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 19 Aug 2022 05:17:49 -0400 Subject: [PATCH] launcher: make missing .repo/repo/repo an error If the specified repo dir doesn't actually have a `repo` program, we only show a warning before continuing on, and then we fail in weird ways. Since we really need the repo dir to contain repo, have this be fatal and delete the results. Bug: https://crbug.com/gerrit/13526 Change-Id: Icee4cba96136d470cbb459a81918c40205078f98 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/343538 Reviewed-by: LaMont Jones Tested-by: Mike Frysinger --- repo | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/repo b/repo index c40e8add..e6ef93de 100755 --- a/repo +++ b/repo @@ -624,8 +624,9 @@ def _Init(args, gitc_init=False): _Checkout(dst, remote_ref, rev, opt.quiet) if not os.path.isfile(os.path.join(dst, 'repo')): - print("warning: '%s' does not look like a git-repo repository, is " - "REPO_URL set correctly?" % url, file=sys.stderr) + print("fatal: '%s' does not look like a git-repo repository, is " + "--repo-url set correctly?" % url, file=sys.stderr) + raise CloneFailure() os.rename(dst, dst_final)