git-status-clear.sh 738 B

123456789101112131415
  1. echo "Post-build git status check..."
  2. echo "Ensuring no changes visible to git have been made to '$*' ..."
  3. git status $* | grep "nothing to commit.*working directory clean" || {
  4. # we should find nothing to commit. If we don't, build has failed.
  5. echo "ERROR: Post-build git status check - FAILED."
  6. echo "Git status reported changes to non-git-ignore'd files."
  7. echo "TO REPRO: Run 'git status $*'. The use git gui or git diff to see what was changed during the build."
  8. echo "TO FIX: Amend your commit and rebuild. Repeat until git status reports no changes both before and after the build."
  9. echo "OUTPUT FOR 'git status $*':"
  10. git status $*
  11. exit 1
  12. }
  13. echo "Post-build git status check - Succeeded."
  14. exit 0