Repository: mesonbuild/meson

Issue:
0.60.0 is incompatible with git < 2.28
**Describe the bug**
When using `wrap-git` subproject wraps, meson version `0.60.0` requires at least git version `2.28`. This version of git is newer than what many linux distributions have available to them in the package repositories.

**To Reproduce**
With the following `meson.build` code:
```
project('Minimal Example')

subproject('meson')
```
and the following `subprojects/meson.wrap` file (any git repo should reproduce the error)
```
[wrap-git]
directory = meson

url = https://github.com/mesonbuild/meson.git
revision = 6ea4e21b6d4b093eea7a3de35941b53475a3b579
```
run `meson build` with meson `0.60.0` and if your git version is less than `2.28` you should get
```
error: unknown switch `b'
usage: git init [-q | --quiet] [--bare] [--template=<template-directory>] [--shared[=<permissions>]] [<directory>]

    --template <template-directory>
                          directory from which templates will be used
    --bare                create a bare repository
    --shared[=<permissions>]
                          specify that the git repository is to be shared amongst several users
    -q, --quiet           be quiet
    --separate-git-dir <gitdir>
                          separate git dir from working tree


meson.build:3:0: ERROR: Git command failed: ['/usr/bin/git', 'init', '-b', 'meson-dummy-branch', 'meson']
``` 

**Expected behavior**
I expected the same behavior that I get when using meson `0.59.3`: the subproject is cloned and the correct revision is checked out, but then fails with the error
```
meson.build:3:0: ERROR: Subproject exists but has no meson.build file
```
Admittedly I should have picked a better example for this report but I couldn't think of an open source repo that had a meson support off the top of my head. 

**system parameters**
* Is this a [cross build](https://mesonbuild.com/Cross-compilation.html) or just a plain native build (for the same computer)?
    * This is a plain bare-metal build
* what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.)
    * Ubuntu 20.04
* what Python version are you using e.g. 3.8.0
    * Python 3.8.10
* what `meson --version`
    * `0.60.0`
* what `ninja --version` if it's a Ninja build
    * N/A



Discussion:
It has been introduced in https://github.com/mesonbuild/meson/pull/9347.
For the record, latest Ubuntu LTS has git 2.25.1, so I agree 2.28 is too recent for now.
Right, I will find a better way to do this tonight.
Also I've gotta say it's fantastic that there is a warning if you don't use it, and if you do use it it fails on recent versions of git.

Resolving patch:
diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py
--- a/mesonbuild/wrap/wrap.py
+++ b/mesonbuild/wrap/wrap.py
@@ -419,7 +419,7 @@ def get_git(self) -> None:
         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)


Test patch: