mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
precommit-hook.sh: Do not complain about untracked *.py scripts in patches/ directory.
This commit is contained in:
parent
f6e27c19e1
commit
4205b76407
@ -1,20 +1,26 @@
|
||||
#!/bin/bash
|
||||
# Installation: ln -s ../../precommit-hook.sh .git/hooks/pre-commit
|
||||
|
||||
for directory in patches debian; do
|
||||
if git status --porcelain "$directory" | grep "^.[^ ]" &> /dev/null; then
|
||||
echo ""
|
||||
echo "*** PLEASE ADD OR STASH YOUR CHANGES IN $directory ***"
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
warning()
|
||||
{
|
||||
echo ""
|
||||
echo "*** $1 ***"
|
||||
echo ""
|
||||
}
|
||||
|
||||
if git status --porcelain "debian" | grep "^.[^ ]" &> /dev/null; then
|
||||
warning "PLEASE ADD OR STASH YOUR CHANGES IN debian"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if git status --porcelain "patches" | grep -v "^.\\?.*\\.py$" | grep "^.[^ ]" &> /dev/null; then
|
||||
warning "PLEASE ADD OR STASH YOUR CHANGES IN patches"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git diff --cached --name-status | while read status file; do
|
||||
if [[ "$file" =~ ^patches/ ]] || [[ "$file" =~ ^debian/tools/ ]] || [[ "$file" =~ ^debian/changelog ]]; then
|
||||
echo ""
|
||||
echo "*** UPDATING AUTOGENERATED FILES ***"
|
||||
echo ""
|
||||
warning "UPDATING AUTOGENERATED FILES"
|
||||
debian/tools/patchupdate.py || exit 1
|
||||
break;
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user