From 8c26230a11207e6bc38320cb9e557f2d0c7086d4 Mon Sep 17 00:00:00 2001 From: Stefan Zweifel Date: Sun, 13 Sep 2020 14:18:41 +0200 Subject: [PATCH] Update git config if not set yet --- tests/commit.bats | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/commit.bats b/tests/commit.bats index 9133547..6994b2d 100644 --- a/tests/commit.bats +++ b/tests/commit.bats @@ -13,7 +13,13 @@ setup() { git init --quiet git add . > /dev/null 2>&1 - git -c user.name="Test Suite" -c user.email="test@github.com" commit --quiet -m "Init Repo" + + if [[ -z $(git config user.name) ]]; then + git config --global user.email "test@github.com" + git config --global user.name "Test Suite" + fi + + git commit --quiet -m "Init Repo" # Set default INPUT variables export INPUT_REPOSITORY="${BATS_TEST_DIRNAME}/test_repo"