aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/wrap
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2023-07-06 11:43:58 -0400
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2023-09-05 09:05:24 +0530
commitf07476a89677f5c87a62b6756b76a0e8ebc4bceb (patch)
tree68945ac725301da244389fd0e2427bd776b60f9b /mesonbuild/wrap
parent6b63c4161d06f7ca79e71246900df1c276a4c1d8 (diff)
downloadmeson-f07476a89677f5c87a62b6756b76a0e8ebc4bceb.zip
meson-f07476a89677f5c87a62b6756b76a0e8ebc4bceb.tar.gz
meson-f07476a89677f5c87a62b6756b76a0e8ebc4bceb.tar.bz2
wrap: Remove duplicated code
Diffstat (limited to 'mesonbuild/wrap')
-rw-r--r--mesonbuild/wrap/wrap.py18
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.