Skip to content
Snippets Groups Projects
Commit 38f95968 authored by Norman Stetter's avatar Norman Stetter
Browse files

Take squashed MRs into account

When a MR is merged via WebUI using the 'squash commits' option the
squashed commit is assigned to the 'squash_commit_sha' property of the
MR object. We have to test for this property too, when looking which MR
a commit belongs to in case the pipeline runs on a squashed commit.
Otherwise parent MR cannot be found.
parent c18d32a5
No related branches found
No related tags found
1 merge request!34Take squashed MRs into account
Pipeline #8164 passed with stage
in 23 seconds
...@@ -26,7 +26,7 @@ def get_merge_requests( ...@@ -26,7 +26,7 @@ def get_merge_requests(
) )
if commit: if commit:
for mr in all_merge_requests: for mr in all_merge_requests:
if mr.sha == commit: if mr.sha == commit or mr.squash_commit_sha == commit:
merge_requests.append(mr) merge_requests.append(mr)
elif all_merge_requests: elif all_merge_requests:
merge_requests = all_merge_requests merge_requests = all_merge_requests
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment