<commit_before>module Heroku::Deploy::Strategy
  class Delta < Base
    include Heroku::Deploy::Task

    def diff
      @diff ||= unless @diff
                  difference = "#{chop_sha deployed_commit}..#{chop_sha new_commit}"
                  task "Performing diff on #{colorize difference, :cyan}" do
                    Heroku::Deploy::Diff.diff deployed_commit, new_commit
                  end
                end
    end

    def perform
      runner.tasks = [
        StashGitChanges.new(self),
        PrepareProductionBranch.new(self)
      ]

      if diff.has_asset_changes?
        runner.tasks << CompileAssets.new(self)
        runner.tasks << CommitAssets.new(self)
      end

      if diff.has_unsafe_migrations?
        runner.tasks << UnsafeMigration.new(self)
      elsif diff.has_migrations?
        runner.tasks << SafeMigration.new(self)
      end

      runner.tasks << PushCode.new(self)

      runner.perform_methods :before_deploy, :deploy, :after_deploy
    end
  end
end
<commit_msg>Cleaned up code in the delta strategy.<commit_after>module Heroku::Deploy::Strategy
  class Delta < Base
    include Heroku::Deploy::Task

    def diff
      @diff ||= unless @diff
                  difference = "#{chop_sha deployed_commit}..#{chop_sha new_commit}"
                  task "Performing diff on #{colorize difference, :cyan}" do
                    Heroku::Deploy::Diff.diff deployed_commit, new_commit
                  end
                end
    end

    def perform
      tasks = [
        StashGitChanges.new(self),
        PrepareProductionBranch.new(self)
      ]

      if diff.has_asset_changes?
        tasks << CompileAssets.new(self)
        tasks << CommitAssets.new(self)
      end

      if diff.has_unsafe_migrations?
        tasks << UnsafeMigration.new(self)
      elsif diff.has_migrations?
        tasks << SafeMigration.new(self)
      end

      tasks << PushCode.new(self)

      runner.tasks = tasks
      runner.perform_methods :before_deploy, :deploy, :after_deploy
    end
  end
end

{'fraction_non_alphanumeric': 0.09077526987242394, 'fraction_numerical': 0.0, 'mean_word_length': 2.1369230769230767, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '655529', 'n_tokens_mistral': 613, 'n_tokens_neox': 588, 'n_words': 128}