<commit_before>class Homesick
  module Actions
    # TODO move this to be more like thor's template, empty_directory, etc
    def git_clone(repo, config = {})
      config ||= {}
      destination = config[:destination] || begin
        repo =~ /([^\/]+)\.git$/
       $1
      end

      destination = Pathname.new(destination) unless destination.kind_of?(Pathname)
      FileUtils.mkdir_p destination.dirname

      if ! destination.directory?
        say_status 'git clone', "#{repo} to #{destination.expand_path}", :green unless options[:quiet]
        system "git clone -q #{repo} #{destination}" unless options[:pretend]
      else
        say_status :exist, destination.expand_path, :blue unless options[:quiet]
      end
    end

    def git_init(path = ".")
      path = Pathname.new(path)

      inside path do
        unless path.join('.git').exist?
          say_status 'git init', '' unless options[:quiet]
          system "git init >/dev/null" unless options[:pretend]
        else
          say_status 'git init', 'already initialized', :blue unless options[:quiet]<commit_msg>Fix git_clone to work with github URLs like https://github.com/technicalpickles/dotpickles<commit_after>class Homesick
  module Actions
    # TODO move this to be more like thor's template, empty_directory, etc
    def git_clone(repo, config = {})
      config ||= {}
      destination = config[:destination] || begin
        repo =~ /([^\/]+)(?:\.git)?$/
       $1
      end

      destination = Pathname.new(destination) unless destination.kind_of?(Pathname)
      FileUtils.mkdir_p destination.dirname

      if ! destination.directory?
        say_status 'git clone', "#{repo} to #{destination.expand_path}", :green unless options[:quiet]
        system "git clone -q #{repo} #{destination}" unless options[:pretend]
      else
        say_status :exist, destination.expand_path, :blue unless options[:quiet]
      end
    end

    def git_init(path = ".")
      path = Pathname.new(path)

      inside path do
        unless path.join('.git').exist?
          say_status 'git init', '' unless options[:quiet]
          system "git init >/dev/null" unless options[:pretend]
        else
          say_status 'git init', 'already initialized', :blue unless options[:quiet]
{'fraction_non_alphanumeric': 0.12301587301587301, 'fraction_numerical': 0.0008818342151675485, 'mean_word_length': 2.81986531986532, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 1, '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': '6779191', 'n_tokens_mistral': 648, 'n_tokens_neox': 618, 'n_words': 185}