Skip to content

Commit 159023d

Browse files
committed
Must use --abbrev-ref if we expect to get a branch name from git rev-parse
1 parent 9046cc4 commit 159023d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

build.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ def assert_clean():
7373
raise BuildError("Working copy must be clean")
7474

7575
def assert_branch(branch="master"):
76-
ref = subprocess.check_output(["git", "rev-parse", "HEAD"])
76+
ref = subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"]).strip()
7777
if ref != branch:
78-
raise BuildError("HEAD must be %s" % (branch,))
78+
raise BuildError("HEAD must be %s, but is %s" % (branch, ref))
7979

8080
def build_config(config):
8181
build_dir = os.path.join(build_base_dir, config)

0 commit comments

Comments
 (0)