diff --git a/changelogs/fragments/ansible-test-azp-change-detection.yml b/changelogs/fragments/ansible-test-azp-change-detection.yml new file mode 100644 index 00000000000..ae69618fa43 --- /dev/null +++ b/changelogs/fragments/ansible-test-azp-change-detection.yml @@ -0,0 +1,2 @@ +bugfixes: + - ansible-test - Correctly detect changes in a GitHub pull request when running on Azure Pipelines. diff --git a/test/lib/ansible_test/_internal/ci/azp.py b/test/lib/ansible_test/_internal/ci/azp.py index 962e838e7c5..f2a9d206cc7 100644 --- a/test/lib/ansible_test/_internal/ci/azp.py +++ b/test/lib/ansible_test/_internal/ci/azp.py @@ -208,10 +208,10 @@ class AzurePipelinesChanges: if self.base_commit: self.base_commit = self.git.run_git(['rev-parse', self.base_commit]).strip() - # ... - # Include commits that are reachable from but exclude those that are reachable from . - # see: https://git-scm.com/docs/gitrevisions - dot_range = '%s..%s' % (self.base_commit, self.commit) + # ... + # This form is to view the changes on the branch containing and up to the second , starting at a common ancestor of both . + # see: https://git-scm.com/docs/git-diff + dot_range = '%s...%s' % (self.base_commit, self.commit) self.paths = sorted(self.git.get_diff_names([dot_range])) self.diff = self.git.get_diff([dot_range])