From 5d5e5e25a230ef6fa9298774c444499384ef9330 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Wed, 25 Jan 2017 17:53:53 -0800 Subject: [PATCH] Only set git config during test if unset. This makes the git test less destructive. --- test/integration/targets/git/tasks/setup.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/integration/targets/git/tasks/setup.yml b/test/integration/targets/git/tasks/setup.yml index 4968fe2c2e6..9df83b3fdc1 100644 --- a/test/integration/targets/git/tasks/setup.yml +++ b/test/integration/targets/git/tasks/setup.yml @@ -21,8 +21,11 @@ shell: gpg --version 2>1 | head -1 | sed -e 's/gpg (GnuPG) //' register: gpg_version -- name: set dummy git config - shell: git config --global user.email "noreply@example.com"; git config --global user.name "Ansible Test Runner" +- name: set git global user.email if not already set + shell: git config --global user.email || git config --global user.email "noreply@example.com" + +- name: set git global user.name if not already set + shell: git config --global user.name || git config --global user.name "Ansible Test Runner" - name: create repo_dir file: path={{repo_dir}} state=directory