From 670529ed8e5978b17bd0cfd7e1133b0232200886 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Tue, 22 Jun 2021 18:29:34 -0300 Subject: tests/remotes.sh: Conditionally set user.{email,name} to work on new env like CI --- tests/remotes.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/remotes.sh b/tests/remotes.sh index 0b52513..4a7ced1 100755 --- a/tests/remotes.sh +++ b/tests/remotes.sh @@ -7,11 +7,21 @@ TEST_PREFIX="$PWD/tests/prefix/$(uuid)" make PREFIX="$TEST_PREFIX" install 1>/dev/null PATH="$PWD/tests:$TEST_PREFIX/bin:$PATH" +if ! git config --global user.email; then + git config --global user.email email@example.com +fi +if ! git config --global user.name; then + git config --global user.name Example +fi + new_repo() { REPO="$PWD/tests/remotes/$(uuid)" mkdir -p "$REPO" cd "$REPO" || exit 1 - git init > /dev/null + git init 1>/dev/null 2>/dev/null || { + git config --global init.defaultBranch + + } git remote add origin "$1" echo '' > f.txt git add f.txt -- cgit v1.2.3