diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2023-07-06 11:43:58 -0400 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2023-09-05 09:05:24 +0530 |
commit | f07476a89677f5c87a62b6756b76a0e8ebc4bceb (patch) | |
tree | 68945ac725301da244389fd0e2427bd776b60f9b /mesonbuild | |
parent | 6b63c4161d06f7ca79e71246900df1c276a4c1d8 (diff) | |
download | meson-f07476a89677f5c87a62b6756b76a0e8ebc4bceb.zip meson-f07476a89677f5c87a62b6756b76a0e8ebc4bceb.tar.gz meson-f07476a89677f5c87a62b6756b76a0e8ebc4bceb.tar.bz2 |
wrap: Remove duplicated code
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/wrap/wrap.py | 18 |
1 files changed, 6 insertions, 12 deletions
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. |