test/lint: Check for working changes before checking scripted diffs

This commit is contained in:
Jack Grigg 2020-10-26 17:57:26 +00:00
parent 001e803b92
commit 1b01bd942b
1 changed files with 7 additions and 0 deletions

View File

@ -17,6 +17,13 @@ if test "x$1" = "x"; then
exit 1 exit 1
fi fi
# Check that the working tree is clean (as this script performs hard resets).
TREE_CHANGES=$(git diff HEAD | wc -l)
if test "x$TREE_CHANGES" != "x0"; then
echo "The working tree is not clean."
exit 1
fi
RET=0 RET=0
PREV_BRANCH=$(git name-rev --name-only HEAD) PREV_BRANCH=$(git name-rev --name-only HEAD)
PREV_HEAD=$(git rev-parse HEAD) PREV_HEAD=$(git rev-parse HEAD)