Fix Azure Pipelines change detection. (#72824)

pull/72839/head
Matt Clay 4 years ago committed by GitHub
parent 2b24fae429
commit 08842cd6bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- ansible-test - Correctly detect changes in a GitHub pull request when running on Azure Pipelines.

@ -208,10 +208,10 @@ class AzurePipelinesChanges:
if self.base_commit:
self.base_commit = self.git.run_git(['rev-parse', self.base_commit]).strip()
# <rev1>...<rev2>
# Include commits that are reachable from <rev2> but exclude those that are reachable from <rev1>.
# see: https://git-scm.com/docs/gitrevisions
dot_range = '%s..%s' % (self.base_commit, self.commit)
# <commit>...<commit>
# This form is to view the changes on the branch containing and up to the second <commit>, starting at a common ancestor of both <commit>.
# 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])

Loading…
Cancel
Save