Skip to content

Commit

Permalink
Raise exception if invalid values are given to 'clone-recursive'
Browse files Browse the repository at this point in the history
  • Loading branch information
andy5995 committed Oct 30, 2024
1 parent c2e120b commit 29710ea
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions mesonbuild/wrap/wrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,9 +622,15 @@ def _get_git(self, packagename: str) -> None:
args += ['--branch', revno]
args += [self.wrap.get('url'), self.directory]
verbose_git(args, self.subdir_root, check=True)
if self.wrap.values.get('clone-recursive', '').lower() == 'true':
verbose_git(['submodule', 'update', '--init', '--checkout', '--recursive', *depth_option],
self.dirname, check=True)

clone_recursive_val = self.wrap.values.get('clone-recursive')
if clone_recursive_val is not None:
clone_recursive_val = self.wrap.values.get('clone-recursive', '').lower()
if clone_recursive_val == 'true':
verbose_git(['submodule', 'update', '--init', '--checkout', '--recursive', *depth_option],
self.dirname, check=True)
elif clone_recursive_val != 'false':
raise WrapException('clone-recursive: invalid value (use \'true\' or \'false\')')
push_url = self.wrap.values.get('push-url')
if push_url:
verbose_git(['remote', 'set-url', '--push', 'origin', push_url], self.dirname, check=True)
Expand Down

0 comments on commit 29710ea

Please sign in to comment.