Use git status --porcelain to test for a clean working directory.
Fix `git rev-parse` error message. Comment on `git status` test for clean.