Skip to content

Commit 3867c9c

Browse files
committed
add git status check to pre-push githook
1 parent c523bfa commit 3867c9c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

.githooks/pre-push

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
#!/usr/bin/env bash
22

33
set -e
4+
5+
git_status="$(git status --porcelain)"
6+
if test -n "$git_status"; then
7+
echo "$git_status"
8+
echo "pre-push hook failed: working directory is dirty"
9+
exit 1
10+
fi
11+
echo "working directory is clean"
12+
413
set -x
514

615
if rg "FIXME" --hidden --glob="!$0" "$PWD"; then

0 commit comments

Comments
 (0)