From 5484d71505baa5ee4e9a4cffb3816a5b33fad806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Fri, 27 Sep 2013 00:29:03 +0200 Subject: fixed i18n dependency when compiled with detached HEAD --- build/util.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'build/util.py') 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.*?)$") - 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) -- cgit v1.2.3