Use basic regexp in grep

This commit is contained in:
2024-10-08 20:25:41 +02:00
parent 1daee0a8ab
commit 516b3bfee7
2 changed files with 28 additions and 1 deletions

View File

@ -102,7 +102,9 @@ do
fi
# Retrieve file state (Added, Modified, Deleted)
STATE=$(${GIT} ${GIT_OPTS[@]} show --name-status --pretty= ${COMMIT_SHA} | grep -E "^..${FILE}\$" | cut -f1)
# Using basic regex as we want to avoid checking '()' or other complex regex patterns.
# This is suboptimal and error prone. But it passes the full backup :-)
STATE=$(${GIT} ${GIT_OPTS[@]} show --name-status --pretty= ${COMMIT_SHA} | grep -G "^..${FILE}\$" | cut -f1)
if test "${STATE}" != "D"
then