Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-28 18:06:57 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-28 18:06:57 +0300
commit7cdd70dcec27402e89e65451b4b1feb75b5eb267 (patch)
tree1691c8e1afd469fa426ecf5bc127de8df16d4855 /app/models/commit.rb
parent79348faced5e7e62103ad27f6a6594dfdca463e2 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index aae49c36899..95993089426 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -464,8 +464,20 @@ class Commit
"commit:#{sha}"
end
+ def expire_note_etag_cache
+ super
+
+ expire_note_etag_cache_for_related_mrs
+ end
+
private
+ def expire_note_etag_cache_for_related_mrs
+ MergeRequest.includes(target_project: :namespace).by_commit_sha(id).find_each do |mr|
+ mr.expire_note_etag_cache
+ end
+ end
+
def commit_reference(from, referable_commit_id, full: false)
reference = project.to_reference(from, full: full)