Enable pipefail, nounset; Simplify some checks
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
REPOSITORY=https://github.com/descartes-underwriting/devops-technical-test-data.git
|
||||
BRANCH=main
|
||||
@ -116,9 +118,7 @@ do
|
||||
fi
|
||||
|
||||
# Retrieve file state (Added, Modified, Deleted)
|
||||
# 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)
|
||||
STATE=$(${GIT} ${GIT_OPTS[@]} show --name-status --pretty= ${COMMIT_SHA} -- "${FILE}" | cut -f1)
|
||||
|
||||
if test "${STATE}" != "D"
|
||||
then
|
||||
|
Reference in New Issue
Block a user