aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/wrap
diff options
context:
space:
mode:
authorL. E. Segovia <amy@amyspark.me>2022-11-30 18:39:54 -0300
committerXavier Claessens <xclaesse@gmail.com>2022-12-07 13:29:04 -0500
commit35599c536271c2d05c82b0f649ad1ab2f2d351d1 (patch)
treef22acbc5ace35d791a602bf00cd31ee5997c8f26 /mesonbuild/wrap
parentbcd50e71d51eac2fa8e1afbb30cb7d5260e0f42a (diff)
downloadmeson-35599c536271c2d05c82b0f649ad1ab2f2d351d1.zip
meson-35599c536271c2d05c82b0f649ad1ab2f2d351d1.tar.gz
meson-35599c536271c2d05c82b0f649ad1ab2f2d351d1.tar.bz2
wrap: Don't use --branch with shallow clones against HEAD
Fixes #10931
Diffstat (limited to 'mesonbuild/wrap')
-rw-r--r--mesonbuild/wrap/wrap.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py
index e8c955a..d949f43 100644
--- a/mesonbuild/wrap/wrap.py
+++ b/mesonbuild/wrap/wrap.py
@@ -582,8 +582,11 @@ class Resolver:
verbose_git(['fetch', self.wrap.get('url'), revno], self.dirname, check=True)
verbose_git(checkout_cmd, self.dirname, check=True)
else:
- verbose_git(['-c', 'advice.detachedHead=false', 'clone', *depth_option, '--branch', revno, self.wrap.get('url'),
- self.directory], self.subdir_root, check=True)
+ args = ['-c', 'advice.detachedHead=false', 'clone', *depth_option]
+ if revno.lower() != 'head':
+ 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)