diff options
| author | Xavier Claessens <xavier.claessens@collabora.com> | 2020-09-16 11:21:04 -0400 |
|---|---|---|
| committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2020-09-18 03:01:15 +0000 |
| commit | da72e6284e15864160d25275906682e4e7354bcb (patch) | |
| tree | d1589b1b27b4b2c888ba26ea566530849dd2731d /mesonbuild/msubprojects.py | |
| parent | e0cd54a32298073830e9141da85aef91dce709e9 (diff) | |
| download | meson-da72e6284e15864160d25275906682e4e7354bcb.tar.gz | |
msubprojects: Revert back to rev-parse instead of --show-current
It is undocumented in manpage, but --show-current is new in git 2.22
which is too recent for distros we want to support like Ubuntu 18.04.
Diffstat (limited to 'mesonbuild/msubprojects.py')
| -rwxr-xr-x | mesonbuild/msubprojects.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/msubprojects.py b/mesonbuild/msubprojects.py index d5153894e..aa7a68204 100755 --- a/mesonbuild/msubprojects.py +++ b/mesonbuild/msubprojects.py @@ -125,7 +125,9 @@ def update_git(wrap, repo_dir, options): mlog.log(' -> No revision specified.') return True try: - branch = git_output(['branch', '--show-current'], repo_dir).strip() + # Same as `git branch --show-current` but compatible with older git version + branch = git_output(['rev-parse', '--abbrev-ref', 'HEAD'], repo_dir).strip() + branch = branch if branch != 'HEAD' else '' except GitException as e: mlog.log(' -> Failed to determine current branch in', mlog.bold(repo_dir)) mlog.log(mlog.red(e.output)) |
