Skip to content

Commit

Permalink
chore: update pre-commit hook to abort if no changes are staged
Browse files Browse the repository at this point in the history
  • Loading branch information
charlottewiltshire0 committed Mar 3, 2025
1 parent 54dba76 commit 1cac300
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ if [ $? -ne 0 ]; then
exit 1
fi

# Skip hook if only whitespace changes
if git diff --cached --quiet --ignore-space-change; then
echo "✈️ Skipping pre-commit hook for whitespace changes"
# Check if there are any staged changes to commit
if git diff --cached --quiet; then
echo "❌ No changes to commit. Aborting."
exit 1
fi

Expand Down

0 comments on commit 1cac300

Please sign in to comment.