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 Nov 3, 2024
1 parent c2e120b commit 24e1ede
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mesonbuild/wrap/wrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,9 +622,13 @@ 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':

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 and clone_recursive_val != 'false':
raise WrapException(f"clone-recursive: invalid value '{clone_recursive_val}' (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 24e1ede

Please sign in to comment.