Merge fort-nix/nix-bitcoin#545: test/lib/create-git-repo: fix variable quoting

49e30f7172 test/lib/create-git-repo: fix empty var expansion (Erik Arvstedt)

Pull request description:

ACKs for top commit:
  jonasnick:
    ACK 49e30f7172

Tree-SHA512: 321f01bd8674e7cc91718e9799e3175cb640feb42ebac90588a60cdbe160b705aac4effa4cc229adc41c062c3cdf7ad90317a4dde90665d71141016faf2ce43a
This commit is contained in:
Jonas Nick 2022-09-07 09:40:59 +00:00
commit ff04de6972
No known key found for this signature in database
GPG Key ID: 4861DBF262123605

View File

@ -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