Commit af657b0509476db56e88014062ccf0a7a6b9d8b7
1 parent
d3559e25
Exists in
master
and in
4 other branches
reset st_commits before setting new value to prevent error when old st_commits is broken
Showing
1 changed file
with
6 additions
and
0 deletions
Show diff stats
app/models/merge_request.rb
| ... | ... | @@ -172,6 +172,12 @@ class MergeRequest < ActiveRecord::Base |
| 172 | 172 | |
| 173 | 173 | def reloaded_commits |
| 174 | 174 | if opened? && unmerged_commits.any? |
| 175 | + # we need to reset st_commits field first | |
| 176 | + # in order to prevent internal rails comparison | |
| 177 | + self.st_commits = [] | |
| 178 | + save | |
| 179 | + | |
| 180 | + # Then we can safely write unmerged commits | |
| 175 | 181 | self.st_commits = unmerged_commits |
| 176 | 182 | save |
| 177 | 183 | end | ... | ... |