diff --git a/scripts/mk_util.py b/scripts/mk_util.py index b5ec691cb..b3d843cc4 100644 --- a/scripts/mk_util.py +++ b/scripts/mk_util.py @@ -76,7 +76,8 @@ GPROF=False def git_hash(): try: - r = subprocess.check_output(['git', 'show-ref', '--abbrev=12', 'HEAD'], shell=True).rstrip('\r\n') + branch = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD'], shell=True).rstrip('\r\n') + r = subprocess.check_output(['git', 'show-ref', '--abbrev=12', 'refs/heads/%s' % branch], shell=True).rstrip('\r\n') except: raise MKException("Failed to retrieve git hash") ls = r.split(' ')