mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
precommit-hook.sh: Do not allow committing when patches/ or debian/ folder has unstaged changes.
This commit is contained in:
parent
f7950d74e6
commit
07de62088d
@ -1,6 +1,15 @@
|
||||
#!/bin/bash
|
||||
# Installation: ln -s ../../precommit-hook.sh .git/hooks/pre-commit
|
||||
|
||||
for directory in patches debian; do
|
||||
if [ ! -z "$(git status --porcelain "$directory")" ]; then
|
||||
echo ""
|
||||
echo "*** PLEASE ADD OR STASH YOUR CHANGES IN $directory ***"
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
git diff --cached --name-status | while read status file; do
|
||||
if [[ "$file" =~ ^patches/ ]] || [[ "$file" =~ ^debian/tools/ ]] || [[ "$file" =~ ^debian/changelog ]]; then
|
||||
echo ""
|
||||
|
Loading…
Reference in New Issue
Block a user