Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions scripts/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,6 @@ fi
# Redirect output to stderr.
exec 1>&2

diff_size=$(git diff | wc -l)

pre_stash_size=$(git stash list | wc -l)
git stash push --quiet --keep-index --include-untracked --message "pre-commit-stash"
post_stash_size=$(git stash list | wc -l)
increased_stash_size=$((post_stash_size - pre_stash_size))

# If the stash size has increased, it means a new stash entry was created.

nocontinue=0

for file in `git diff --cached --name-only`
Expand Down Expand Up @@ -123,12 +114,7 @@ do
fi
done

if [ $increased_stash_size -gt 0 ]; then
git stash pop --quiet --index
fi

if [ $nocontinue -ne 0 ]; then
printf '\033[38;5;208m%s\033[0m\n' "Pre-commit found errors. Did you add the latest changes?"
echo "Note: To correct typos and fix indentation, run ./scripts/spell_check_and_indent.sh"
fi

Expand Down
Loading