Fix .repo detection bugs.

cbuildbot has stricter logic for detecting whether a repo is valid than
repo does, which results in cbuildbot reporting the following error
incorrectly:

cbuildbot: error: Configured buildroot '...' points into a repository
checkout, rather than the root of it.  This is not supported.

This error happens specifically because cbuildbot checks for both the
'manifests' and 'repo' subdirs under .repo, whereas repo itself checks for
a working repo executable under the 'repo' subdir. Since we can't check
for repo working without running it (and that's slow), I've instead cleaned up
cbuildbot to instead have looser checks compared to repo and just look for the
existence of the .repo dir. This is sufficient for fixing the bugs above
and reduces the complexity of our code.

BUG=chromium:239494
TEST=Remote trybot runs, all unit tests.

Change-Id: I8c030ebf553b18e246fdb7a39dda0405663a3eac
Reviewed-on: https://gerrit.chromium.org/gerrit/50669
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
diff --git a/scripts/cbuildbot.py b/scripts/cbuildbot.py
index 3b5ec68..752eafa 100644
--- a/scripts/cbuildbot.py
+++ b/scripts/cbuildbot.py
@@ -1329,7 +1329,7 @@
   # Sanity check of buildroot- specifically that it's not pointing into the
   # midst of an existing repo since git-repo doesn't support nesting.
   if (not repository.IsARepoRoot(options.buildroot) and
-      repository.InARepoRepository(options.buildroot)):
+      git.FindRepoDir(options.buildroot)):
     parser.error('Configured buildroot %s points into a repository checkout, '
                  'rather than the root of it.  This is not supported.'
                  % options.buildroot)