mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-22 23:29:32 +01:00
Fix rebuildPatches and grep colors not reverting junk changes
we've seen some index lines change in length in some PR's, though this script was suppose to ignore those changes already. The only way I can see that not working is if the color mode of grep is breaking the pattern matching, as some people default their grep to use color=always this adds color=none to ensure colors are disabled, should ensure it.
This commit is contained in:
parent
f21e10da65
commit
e020015aad
1 changed files with 2 additions and 2 deletions
|
@ -14,9 +14,9 @@ function cleanupPatches {
|
|||
for patch in *.patch; do
|
||||
echo "$patch"
|
||||
gitver=$(tail -n 2 "$patch" | grep -ve "^$" | tail -n 1)
|
||||
diffs=$($gitcmd diff --staged "$patch" | grep -E "^(\+|\-)" | grep -Ev "(From [a-z0-9]{32,}|\-\-\- a|\+\+\+ b|.index)")
|
||||
diffs=$($gitcmd diff --staged "$patch" | grep --color=none -E "^(\+|\-)" | grep --color=none -Ev "(From [a-z0-9]{32,}|\-\-\- a|\+\+\+ b|^.index)")
|
||||
|
||||
testver=$(echo "$diffs" | tail -n 2 | grep -ve "^$" | tail -n 1 | grep "$gitver")
|
||||
testver=$(echo "$diffs" | tail -n 2 | grep --color=none -ve "^$" | tail -n 1 | grep --color=none "$gitver")
|
||||
if [ "x$testver" != "x" ]; then
|
||||
diffs=$(echo "$diffs" | sed 'N;$!P;$!D;$d')
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue