summaryrefslogtreecommitdiffstats
path: root/build/util.py
diff options
context:
space:
mode:
authorDaniel Schürmann <daschuer@mixxx.org>2013-09-27 00:29:03 +0200
committerDaniel Schürmann <daschuer@mixxx.org>2013-09-27 00:29:03 +0200
commit5484d71505baa5ee4e9a4cffb3816a5b33fad806 (patch)
tree99a7ae757454aa123088abc6a49feaf981cfd34d /build/util.py
parent92254ae3ed7bdbf79ad7424259048a7afc6eda43 (diff)
fixed i18n dependency when compiled with detached HEAD
Diffstat (limited to 'build/util.py')
-rw-r--r--build/util.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/build/util.py b/build/util.py
index a27e6d4a0f..328611d5ca 100644
--- a/build/util.py
+++ b/build/util.py
@@ -75,13 +75,11 @@ def get_git_modified():
return "\n".join(modified_files)
def get_git_branch_name():
- branch_matcher = re.compile("\* (?P<branch>.*?)$")
- for line in os.popen("git branch").read().splitlines():
- match = branch_matcher.match(line)
- if match:
- match = match.groupdict()
- return match['branch'].strip()
- return None
+ # this returns the branch name or 'HEAD' in case of detached HEAD
+ branch_name = os.popen("git rev-parse --abbrev-ref HEAD").readline().strip()
+ if branch_name == 'HEAD':
+ branch_name = '(no branch)'
+ return branch_name
def export_git(source, dest):
os.mkdir(dest)