From 49e30f7172b154f6fc9e6ad062d1f624e7120d58 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Fri, 2 Sep 2022 15:12:06 +0200 Subject: [PATCH] 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). --- test/lib/create-git-repo.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/lib/create-git-repo.sh b/test/lib/create-git-repo.sh index 3549904..6721b4b 100644 --- a/test/lib/create-git-repo.sh +++ b/test/lib/create-git-repo.sh @@ -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