From 2cf68c252fa4df7fc7ce20eb5c8948dca1ec60b2 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Fri, 26 May 2023 15:57:13 -0700 Subject: [PATCH] [stable-2.12] ansible-test - local change detection without --fork-point (#79734) (#80902) (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 038f3988376..ac8882afa78 100644 --- a/test/lib/ansible_test/_internal/git.py +++ b/test/lib/ansible_test/_internal/git.py @@ -76,7 +76,7 @@ class Git: def get_branch_fork_point(self, branch): # type: (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): # type: (str) -> bool