From f07476a89677f5c87a62b6756b76a0e8ebc4bceb Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 6 Jul 2023 11:43:58 -0400 Subject: wrap: Remove duplicated code --- mesonbuild/wrap/wrap.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'mesonbuild/wrap') diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py index c0dd01c..c857050 100644 --- a/mesonbuild/wrap/wrap.py +++ b/mesonbuild/wrap/wrap.py @@ -568,12 +568,6 @@ class Resolver: revno = self.wrap.get('revision') verbose_git(['fetch', *depth_option, 'origin', revno], self.dirname, check=True) verbose_git(checkout_cmd, self.dirname, check=True) - if self.wrap.values.get('clone-recursive', '').lower() == 'true': - verbose_git(['submodule', 'update', '--init', '--checkout', - '--recursive', *depth_option], self.dirname, check=True) - push_url = self.wrap.values.get('push-url') - if push_url: - verbose_git(['remote', 'set-url', '--push', 'origin', push_url], self.dirname, check=True) else: if not is_shallow: verbose_git(['clone', self.wrap.get('url'), self.directory], self.subdir_root, check=True) @@ -587,12 +581,12 @@ class Resolver: 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) - push_url = self.wrap.values.get('push-url') - if push_url: - verbose_git(['remote', 'set-url', '--push', 'origin', push_url], self.dirname, check=True) + if self.wrap.values.get('clone-recursive', '').lower() == 'true': + verbose_git(['submodule', 'update', '--init', '--checkout', '--recursive', *depth_option], + self.dirname, check=True) + push_url = self.wrap.values.get('push-url') + if push_url: + verbose_git(['remote', 'set-url', '--push', 'origin', push_url], self.dirname, check=True) def validate(self) -> None: # This check is only for subprojects with wraps. -- cgit v1.1