diff options
author | Adam Niedzielski <adamsunday@gmail.com> | 2017-06-26 18:36:09 +0300 |
---|---|---|
committer | Adam Niedzielski <adamsunday@gmail.com> | 2017-06-26 18:36:09 +0300 |
commit | 0eb3d18c569cbae0f4b58284857c7a21972c4153 (patch) | |
tree | 50d70b3ce1fb007457cebff4dfcad44fafdbb7f5 /app/models | |
parent | d4384dc154cb1e44c7b0a5cd802d48629f585fdb (diff) |
Store merge request ref_fetched status in the database
Closes #34052
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/merge_request.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index f581a25f093..c099d731082 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -771,6 +771,7 @@ class MergeRequest < ActiveRecord::Base "refs/heads/#{source_branch}", ref_path ) + update_column(:ref_fetched, true) end def ref_path @@ -778,7 +779,13 @@ class MergeRequest < ActiveRecord::Base end def ref_fetched? - project.repository.ref_exists?(ref_path) + super || + begin + computed_value = project.repository.ref_exists?(ref_path) + update_column(:ref_fetched, true) if computed_value + + computed_value + end end def ensure_ref_fetched |