From fa0bd4f78947ff66f25e2939aaa7e419aeb68666 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Wed, 13 Feb 2013 08:16:08 -0800 Subject: [PATCH] Fix git_hash function Signed-off-by: Leonardo de Moura --- scripts/mk_util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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(' ')