diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2021-10-25 21:13:21 -0400 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2021-10-27 10:44:11 -0400 |
commit | 6ed13326034f5616b4b886d3831a7168841460c4 (patch) | |
tree | f9b779be68a9dc66ddf94d4498ef9d8601180f59 /mesonbuild/wrap | |
parent | 135b3bc0fd5e283e01e1401370909e99bdaa88a1 (diff) | |
download | meson-6ed13326034f5616b4b886d3831a7168841460c4.zip meson-6ed13326034f5616b4b886d3831a7168841460c4.tar.gz meson-6ed13326034f5616b4b886d3831a7168841460c4.tar.bz2 |
wrap: fix support for git < 2.28
both of these do the same thing:
init -b <branchname>
-c init.defaultBranch=<branchname> init
The latter contributes to unreadably long lines of code, but has the
advantage of working on older versions of git.
Fixes #9449
Diffstat (limited to 'mesonbuild/wrap')
-rw-r--r-- | mesonbuild/wrap/wrap.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py index 0cc68f0..08da319 100644 --- a/mesonbuild/wrap/wrap.py +++ b/mesonbuild/wrap/wrap.py @@ -418,7 +418,7 @@ class Resolver: if is_shallow and self.is_git_full_commit_id(revno): # git doesn't support directly cloning shallowly for commits, # so we follow https://stackoverflow.com/a/43136160 - verbose_git(['init', '-b', 'meson-dummy-branch', self.directory], self.subdir_root, check=True) + verbose_git(['-c', 'init.defaultBranch=meson-dummy-branch', 'init', self.directory], self.subdir_root, check=True) verbose_git(['remote', 'add', 'origin', self.wrap.get('url')], self.dirname, check=True) revno = self.wrap.get('revision') verbose_git(['fetch', *depth_option, 'origin', revno], self.dirname, check=True) |