Enable pipefail, nounset; Simplify some checks
This commit is contained in:
parent
8324384f88
commit
010c1f65ab
@ -61,7 +61,11 @@ new commit: 46fe26c9dcf2354a0ed3f304ed6818de9606f7b5
|
||||
new commit: 21e5331d1c0256701bb90cf017e519d54a88f618
|
||||
new commit: 47998b5317e66b3bd456cfb07268c93e223704f2
|
||||
...
|
||||
done: 1342 commits
|
||||
done: 4307 commits
|
||||
|
||||
$ ls -ld all/* | wc -l
|
||||
4307
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user