aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2020-08-07 09:32:51 -0400
committerXavier Claessens <xclaesse@gmail.com>2020-09-10 11:39:30 -0400
commit3d443d84bdfd4987dbe299ac3b5fad591d01bced (patch)
treeaf1788a27fbeeead86319ce27d28b4a49c88af3f
parent400a35e9ea696e9adef14274347b2e907bbec6bf (diff)
downloadmeson-3d443d84bdfd4987dbe299ac3b5fad591d01bced.zip
meson-3d443d84bdfd4987dbe299ac3b5fad591d01bced.tar.gz
meson-3d443d84bdfd4987dbe299ac3b5fad591d01bced.tar.bz2
msubprojects: Use less cryptic "git branch --show-current" command
It describes well what it does, compared to obscure "rev-parse".
-rwxr-xr-xmesonbuild/msubprojects.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/msubprojects.py b/mesonbuild/msubprojects.py
index b482a25..4575181 100755
--- a/mesonbuild/msubprojects.py
+++ b/mesonbuild/msubprojects.py
@@ -53,8 +53,8 @@ def update_git(wrap, repo_dir, options):
mlog.log(' -> Not used.')
return
revision = wrap.get('revision')
- ret = git_output(['rev-parse', '--abbrev-ref', 'HEAD'], repo_dir).strip()
- if ret == 'HEAD':
+ branch = git_output(['branch', '--show-current'], repo_dir).strip()
+ if branch == '':
try:
# We are currently in detached mode, just checkout the new revision
git_output(['fetch'], repo_dir)
@@ -65,7 +65,7 @@ def update_git(wrap, repo_dir, options):
mlog.log(mlog.red(out))
mlog.log(mlog.red(str(e)))
return
- elif ret == revision:
+ elif branch == revision:
try:
# We are in the same branch, pull latest commits
git_output(['-c', 'rebase.autoStash=true', 'pull', '--rebase'], repo_dir)