Apparently this is the correct regex.

By: md_5 <md_5@live.com.au>
This commit is contained in:
Spigot 2013-01-19 19:24:36 +11:00
parent 9ed1f633a0
commit fe0864051c

View file

@ -5,7 +5,7 @@ echo "Rebuilding patch files from current fork state..."
function cleanupPatches {
cd $1
for patch in *.patch; do
lines=$(git diff --staged $patch | grep -E "^(\+|\-)" | grep -Ev "(From [a-z0-9]{32,}|--- a|+++ b)" | wc -l)
lines=$(git diff --staged $patch | grep -E "^(\+|\-)" | grep -Ev "(From [a-z0-9]{32,}|\-\-\- a|\+\+\+ b|.index)" | wc -l)
if [ "$lines" == "0" ] ; then
git reset HEAD $patch >/dev/null
git checkout -- $patch >/dev/null