Skip to content

Commit

Permalink
e Add meaningful error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
claremacrae committed Feb 20, 2020
1 parent 8c5657c commit 44bd3db
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions build/prepare_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,15 @@ def check_pre_conditions_for_publish(self):
repo = Repo(self.details.main_project_dir)
assert not repo.bare

# run(["git", "branch"])
assert (repo.active_branch.name == 'master')
# check_step("we are on the master branch")

# run(["git", "status"])
# From https://stackoverflow.com/questions/31959425/how-to-get-staged-files-using-gitpython
assert (len(repo.index.diff(None)) == 0) # Modified
assert (len(repo.index.diff("HEAD")) == 0) # Staged
# check_step("everything is committed")
assert len(repo.index.diff(None)) == 0, "there are un-committed changes to ApprovalTests.cpp" # Modified
assert len(repo.index.diff("HEAD")) == 0, "there are un-committed changes to ApprovalTests.cpp" # Staged

# From https://stackoverflow.com/questions/15849640/how-to-get-count-of-unpublished-commit-with-gitpython
assert (len(list(repo.iter_commits('master@{u}..master'))) == 0)
# check_step("everything is pushed")
assert len(
list(repo.iter_commits('master@{u}..master'))) == 0, "there are un-pushed changes in ApprovalTests.cpp"

run(["open", "https://github.com/approvals/ApprovalTests.cpp/commits/master"])
check_step("the builds are passing")
Expand Down

0 comments on commit 44bd3db

Please sign in to comment.