Skip to content

Commit

Permalink
pw_env_setup: Add check for git in _check_submodule_presence
Browse files Browse the repository at this point in the history
If the checkout isn't using git (Cog), don't try updating
git submodules.

Change-Id: I6517d2573f4032b75c118b425e9e91d20906a23a
Test: confirmed check passes when using git
Test: confirmed check fails when using Cog
Bug: 365557573
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/234212
Commit-Queue: Alan Rosenthal <[email protected]>
Lint: Lint 🤖 <[email protected]>
Reviewed-by: Jonathon Reinhart <[email protected]>
Reviewed-by: Rob Mohr <[email protected]>
Reviewed-by: Erik Gilling <[email protected]>
  • Loading branch information
AlanRosenthal authored and CQ Bot Account committed Sep 9, 2024
1 parent ae663f3 commit 16f0f63
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pw_env_setup/py/pw_env_setup/env_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,9 @@ def _parse_config_file(self, config_file):
def _check_submodule_presence(self):
uninitialized = set()

# Don't check submodule presence if using the Android Repo Tool.
if os.path.isdir(os.path.join(self._project_root, '.repo')):
# If there's no `.git` file or directory, then we are not in
# a git repo and must skip the git-submodule check.
if not os.path.exists(os.path.join(self._project_root, '.git')):
return

if not self._check_submodules:
Expand Down

0 comments on commit 16f0f63

Please sign in to comment.