app/models/merge_request_diff.rb
# Reload diffs between branches related to current merge request from repo
# and save it as array of hashes in st_diffs db field
Reload diffs between branches related to current merge request from repo
and save it as array of hashes in st_diffs db field
Reload diffs between branches related to current merge request from repo and save it as array of hashes in st_diffs db field
def reload_diffs
    new_diffs = []
    if commits.size.zero?
      self.state = :empty
    else
      diff_collection = unmerged_diffs
      if diff_collection.overflow?
        self.state = :overflow
      end
      self.real_size = diff_collection.real_size
      if diff_collection.any?
        new_diffs = dump_diffs(diff_collection)
        self.state = :collected
      end
    end
    self.st_diffs = new_diffs
    self.base_commit_sha = self.repository.merge_base(self.source_sha, self.target_branch)
    self.save
  end
def reload_diffs new_diffs = [ ] if commits . size . zero? self . state = :empty else diff_collection = unmerged_diffs if diff_collection . overflow? self . state = :overflow end self . real_size = diff_collection . real_size if diff_collection . any? new_diffs = dump_diffs ( diff_collection ) self . state = :collected end end self . st_diffs = new_diffs self . base_commit_sha = self . repository . merge_base ( self . source_sha , self . target_branch ) self . save end
Reload diffs between branches related to current merge request from repo
and save it as array of hashes in st_diffs db field
Reload diffs between branches related to current merge request from repo and save it as array of hashes in st_diffs db field
# Set our state to 'overflow' to make the #empty? and #collected? # methods (generated by StateMachine) return false.