<commit_before>require "git"
require "git-ssh-wrapper"

module HerokuAppDeployer
module GitHubToHerokuDeployer
  class Git

    def initialize(configuration)
      @heroku_repo = configuration["heroku_repo"]
      @github_repo = configuration["github_repo"]
    end

    def push_app_to_heroku
      repo = open_or_setup
      wrapped_push(repo)
    end

    def open_or_setup
      local_folder = "repos/#{Zlib.crc32(@github_repo)}"

      repo = begin
        Git.open(local_folder).tap do |g|
          g.fetch
          g.remote("origin").merge
        end
      rescue ArgumentError => e
        `rm -r #{local_folder}`
        wrapped_clone(@github_repo, local_folder)
        retry
      end
      repo.add_remote("heroku", @heroku_repo) unless repo.remote("heroku").url<commit_msg>removes extraneous line'<commit_after>require "git"
require "git-ssh-wrapper"

module HerokuAppDeployer
  class Git

    def initialize(configuration)
      @heroku_repo = configuration["heroku_repo"]
      @github_repo = configuration["github_repo"]
    end

    def push_app_to_heroku
      repo = open_or_setup
      wrapped_push(repo)
    end

    def open_or_setup
      local_folder = "repos/#{Zlib.crc32(@github_repo)}"

      repo = begin
        Git.open(local_folder).tap do |g|
          g.fetch
          g.remote("origin").merge
        end
      rescue ArgumentError => e
        `rm -r #{local_folder}`
        wrapped_clone(@github_repo, local_folder)
        retry
      end
      repo.add_remote("heroku", @heroku_repo) unless repo.remote("heroku").url
{'fraction_non_alphanumeric': 0.09813983322642719, 'fraction_numerical': 0.0025657472738935213, 'mean_word_length': 2.741007194244604, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2110725', 'n_tokens_mistral': 500, 'n_tokens_neox': 492, 'n_words': 97}