diff options
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/auto_merge/merge_when_pipeline_succeeds_service.rb | 2 | ||||
-rw-r--r-- | app/services/system_note_service.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/app/services/auto_merge/merge_when_pipeline_succeeds_service.rb b/app/services/auto_merge/merge_when_pipeline_succeeds_service.rb index c41073a73e9..cde8c19e8fc 100644 --- a/app/services/auto_merge/merge_when_pipeline_succeeds_service.rb +++ b/app/services/auto_merge/merge_when_pipeline_succeeds_service.rb @@ -5,7 +5,7 @@ module AutoMerge def execute(merge_request) super do if merge_request.saved_change_to_auto_merge_enabled? - SystemNoteService.merge_when_pipeline_succeeds(merge_request, project, current_user, merge_request.diff_head_commit) + SystemNoteService.merge_when_pipeline_succeeds(merge_request, project, current_user, merge_request.actual_head_pipeline.sha) end end end diff --git a/app/services/system_note_service.rb b/app/services/system_note_service.rb index 237ddbcf2c2..4783417ad6d 100644 --- a/app/services/system_note_service.rb +++ b/app/services/system_note_service.rb @@ -221,8 +221,8 @@ module SystemNoteService end # Called when 'merge when pipeline succeeds' is executed - def merge_when_pipeline_succeeds(noteable, project, author, last_commit) - body = "enabled an automatic merge when the pipeline for #{last_commit.to_reference(project)} succeeds" + def merge_when_pipeline_succeeds(noteable, project, author, sha) + body = "enabled an automatic merge when the pipeline for #{sha} succeeds" create_note(NoteSummary.new(noteable, project, author, body, action: 'merge')) end |