Skip to content

Commit

Permalink
Improved pre-commit.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Defelo committed Apr 1, 2022
1 parent c791c7d commit 2e44df4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pre-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ if [[ "$1" = "install" ]]; then
exit 0
fi

tmp=$(mktemp)
git diff > $tmp
git apply --allow-empty -R $tmp
git diff > unstaged.patch
git apply --allow-empty -R unstaged.patch

$HOME/.local/bin/poe pre-commit
code=$?

git add -u
git apply --allow-empty $tmp
rm $tmp
git apply --allow-empty unstaged.patch && rm unstaged.patch

exit $code

0 comments on commit 2e44df4

Please sign in to comment.