<commit_before>module Match
  class ChangePassword
    def self.update(params: nil, from: nil, to: nil)
      to ||= UI.password("New password: ")
      GitHelper.clear_changes
      workspace = GitHelper.clone(params[:git_url], params[:shallow_clone], manual_password: from)
      Encrypt.new.clear_password(params[:git_url])
      Encrypt.new.store_password(params[:git_url], to)

      message = "[fastlane] Changed password"
      GitHelper.commit_changes(workspace, message, params[:git_url])
    end
  end
end
<commit_msg>Also ask twice under change_password command<commit_after>module Match
  class ChangePassword
    def self.update(params: nil, from: nil, to: nil)
      to ||= ChangePassword.ask_password("New passphrase for Git Repo: ")
      GitHelper.clear_changes
      workspace = GitHelper.clone(params[:git_url], params[:shallow_clone], manual_password: from)
      Encrypt.new.clear_password(params[:git_url])
      Encrypt.new.store_password(params[:git_url], to)

      message = "[fastlane] Changed passphrase"
      GitHelper.commit_changes(workspace, message, params[:git_url])
    end

    def self.ask_password(msg="Passphrase for Git Repo: ")
      password = ""
      while password.to_s.length == 0
        password = ask(msg.yellow) { |q| q.echo = "*" }
        password2 = ask("Type passphrase again: ".yellow) { |q| q.echo = "*" }
        if password != password2
          UI.error("Passhprases differ. Try again")
          password = ""
        end
      end
      password
    end
  end
end

{'fraction_non_alphanumeric': 0.11656843483955469, 'fraction_numerical': 0.0019646365422396855, 'mean_word_length': 3.3163841807909606, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5690286', 'n_tokens_mistral': 466, 'n_tokens_neox': 460, 'n_words': 106}