<commit_before>require_relative 'base'

module VagrantPlugins
  module ProxyConf
    class Action
      # Action for configuring Git on the guest
      class ConfigureGitProxy < Base
        def config_name
          'git_proxy'
        end

        private

        # @return [Vagrant::Plugin::V2::Config] the configuration
        def config
          return @config if @config

          # Use only `config.git_proxy`, don't merge with the default config
          @config = @machine.config.git_proxy
          finalize_config(@config)
        end

        def configure_machine
          command = "#{git_path} config --system "
          if config.http
            command << "http.proxy #{config.http}"
          else
            command << "--unset-all http.proxy"
          end
          @machine.communicate.sudo(command)<commit_msg>Don't fail if removing non-existing git proxy configuration<commit_after>require_relative 'base'

module VagrantPlugins
  module ProxyConf
    class Action
      # Action for configuring Git on the guest
      class ConfigureGitProxy < Base
        def config_name
          'git_proxy'
        end

        private

        # @return [Vagrant::Plugin::V2::Config] the configuration
        def config
          return @config if @config

          # Use only `config.git_proxy`, don't merge with the default config
          @config = @machine.config.git_proxy
          finalize_config(@config)
        end

        def configure_machine
          if config.http
            @machine.communicate.sudo(
              "#{git_path} config --system http.proxy #{config.http}")
          else
            @machine.communicate.sudo(
              "#{git_path} config --system --unset-all http.proxy",
              error_check: false)
          end
{'fraction_non_alphanumeric': 0.07782754759238522, 'fraction_numerical': 0.0011198208286674132, 'mean_word_length': 1.9295081967213115, 'pattern_counts': {'":': 0, '<': 9, '<?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': '1365186', 'n_tokens_mistral': 474, 'n_tokens_neox': 459, 'n_words': 135}