diff options
author | EuAndreh <eu@euandre.org> | 2021-06-22 18:29:34 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2021-06-22 18:29:34 -0300 |
commit | 670529ed8e5978b17bd0cfd7e1133b0232200886 (patch) | |
tree | 432e69f7b0f72b8ac6d23123d3692634cc368a8b | |
parent | aux/tests-lib.sh: Add uuid() function, use it on tests (diff) | |
download | git-permalink-670529ed8e5978b17bd0cfd7e1133b0232200886.tar.gz git-permalink-670529ed8e5978b17bd0cfd7e1133b0232200886.tar.xz |
tests/remotes.sh: Conditionally set user.{email,name} to work on new env like CI
-rwxr-xr-x | tests/remotes.sh | 12 |
1 files changed, 11 insertions, 1 deletions
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 |