From 88042f98d67353a78e909794013532e7cc91f1f0 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Fri, 26 May 2023 15:56:39 -0700 Subject: [PATCH] [stable-2.15] ansible-test - local change detection without --fork-point (#79734) (#80899) (cherry picked from commit a5bb4c7deea0561a947702483355a90000f7980b) Co-authored-by: Felix Fontein --- changelogs/fragments/79734-ansible-test-change-detection.yml | 2 ++ test/lib/ansible_test/_internal/git.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/79734-ansible-test-change-detection.yml diff --git a/changelogs/fragments/79734-ansible-test-change-detection.yml b/changelogs/fragments/79734-ansible-test-change-detection.yml new file mode 100644 index 00000000000..7eb939fd1d2 --- /dev/null +++ b/changelogs/fragments/79734-ansible-test-change-detection.yml @@ -0,0 +1,2 @@ +bugfixes: + - "ansible-test local change detection - use ``git merge-base HEAD`` instead of ``git merge-base --fork-point `` (https://github.com/ansible/ansible/pull/79734)." diff --git a/test/lib/ansible_test/_internal/git.py b/test/lib/ansible_test/_internal/git.py index 4685f1d28cf..b6c5c7b49d1 100644 --- a/test/lib/ansible_test/_internal/git.py +++ b/test/lib/ansible_test/_internal/git.py @@ -77,7 +77,7 @@ class Git: def get_branch_fork_point(self, branch: str) -> str: """Return a reference to the point at which the given branch was forked.""" - cmd = ['merge-base', '--fork-point', branch] + cmd = ['merge-base', branch, 'HEAD'] return self.run_git(cmd).strip() def is_valid_ref(self, ref: str) -> bool: