From 24e1eded5e9ecb6af59aa4d70cc16c6c47fea071 Mon Sep 17 00:00:00 2001 From: andy5995 Date: Wed, 30 Oct 2024 11:48:07 -0500 Subject: [PATCH] Raise exception if invalid values are given to 'clone-recursive' --- mesonbuild/wrap/wrap.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py index 7aae1663fd1f..86990715fadc 100644 --- a/mesonbuild/wrap/wrap.py +++ b/mesonbuild/wrap/wrap.py @@ -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)