From 1eb83548fa29cd948528699896378de0f91b78fe Mon Sep 17 00:00:00 2001
From: Rafael Guterres Jeffman <rjeffman@redhat.com>
Date: Tue, 6 Sep 2022 15:47:01 -0300
Subject: [PATCH] upstream CI: Ensure 'master' branch is available for
 set_test_modules

If the repository is setup in a way that master branch is not available
for comparing the current HEAD against it, the comparison will fail and
not module/role will be scheduled for testing.

This patch forces fetching 'master' from ansible-freeipa repository,
allowing the comparison to be performed.
---
 utils/set_test_modules | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/utils/set_test_modules b/utils/set_test_modules
index b93e38ce..6f73ef87 100644
--- a/utils/set_test_modules
+++ b/utils/set_test_modules
@@ -18,7 +18,12 @@ pushd "${TOPDIR}" >/dev/null 2>&1 || die "Failed to change directory."
 
 files_list=$(mktemp)
 
-BASE_BRANCH=${BASE_BRANCH:-"master"}
+if [ -z "$BASE_BRANCH" ]
+then
+    git remote add  _temp https://github.com/freeipa/ansible-freeipa
+    git fetch --prune --no-tags --quiet _temp
+    BASE_BRANCH="master"
+fi
 git diff "${BASE_BRANCH}" --name-only > "${files_list}"
 
 # Get all modules that should have tests executed
-- 
GitLab