summaryrefslogtreecommitdiff
path: root/app/models/merge_request.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/merge_request.rb')
-rw-r--r--app/models/merge_request.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index 485ca3a3850..f3488f6ea60 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -1478,6 +1478,7 @@ class MergeRequest < ApplicationRecord
def fetch_ref!
target_project.repository.fetch_source_branch!(source_project.repository, source_branch, ref_path)
+ expire_ancestor_cache
end
# Returns the current merge-ref HEAD commit.
@@ -2037,6 +2038,10 @@ class MergeRequest < ApplicationRecord
self.draft = draft?
end
+ def expire_ancestor_cache
+ project.repository.expire_ancestor_cache(target_branch_sha, diff_head_sha)
+ end
+
def missing_report_error(report_type)
{ status: :error, status_reason: "This merge request does not have #{report_type} reports" }
end