test/lib/create-git-repo: fix empty var expansion
When `amend` is empty, expand it to nothing instead of an empty string (which causes a git error).
This commit is contained in:
parent
462c2541d7
commit
49e30f7172
|
@ -2,14 +2,14 @@
|
|||
(
|
||||
# shellcheck disable=SC2154,SC2164
|
||||
cd "$scriptDir/.."
|
||||
amend=--amend
|
||||
amend=(--amend)
|
||||
|
||||
if [[ ! -e .git ]] || ! git rev-parse HEAD 2>/dev/null; then
|
||||
git init
|
||||
amend=
|
||||
amend=()
|
||||
fi
|
||||
git add .
|
||||
if ! git diff --quiet --cached; then
|
||||
git commit -a "$amend" -m -
|
||||
git commit -a "${amend[@]}" -m -
|
||||
fi
|
||||
) >/dev/null
|
||||
|
|
Loading…
Reference in New Issue
Block a user