<commit_before>require 'redmine/scm/adapters/undev_git_adapter'

class Repository::UndevGit < Repository

  class UrlValidator < ActiveModel::EachValidator
    def validate_each(record, attribute, value)
      regexp = /\A(https?|git):\/\/[\w\d\-_\.\/@:]+\z/
      unless (value =~ regexp) || File.readable_real?(value)
        record.errors.add(attribute, I18n.t(:repository_url_malformed))
      end
    end
  end

  # root_url stores path to local bare repository
  attr_protected :root_url

  safe_attributes 'use_init_hooks', 'use_init_refs'

  # Storage folder for local copies of remote repositories
  cattr_accessor :repo_storage_dir
  self.repo_storage_dir = Redmine::Configuration['scm_repo_storage_dir'] || Rails.root.join('repos')

  has_many :hooks,
           :class_name => 'ProjectHook',
           :foreign_key => 'repository_id',
           :dependent => :destroy
<commit_msg>using target path of symlink in scm_repo_storage_dir<commit_after>require 'redmine/scm/adapters/undev_git_adapter'

class Repository::UndevGit < Repository

  class UrlValidator < ActiveModel::EachValidator
    def validate_each(record, attribute, value)
      regexp = /\A(https?|git):\/\/[\w\d\-_\.\/@:]+\z/
      unless (value =~ regexp) || File.readable_real?(value)
        record.errors.add(attribute, I18n.t(:repository_url_malformed))
      end
    end
  end

  # root_url stores path to local bare repository
  attr_protected :root_url

  safe_attributes 'use_init_hooks', 'use_init_refs'

  # Storage folder for local copies of remote repositories
  cattr_accessor :repo_storage_dir
  self.repo_storage_dir = Redmine::Configuration['scm_repo_storage_dir'] || begin
    rpath = Rails.root.join('repos')
    rpath.symlink? ? File.readlink(rpath) : rpath
  end

  has_many :hooks,
           :class_name => 'ProjectHook',
           :foreign_key => 'repository_id',
           :dependent => :destroy

{'fraction_non_alphanumeric': 0.1167806417674908, 'fraction_numerical': 0.0021041557075223566, 'mean_word_length': 3.778894472361809, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '5544249', 'n_tokens_mistral': 636, 'n_tokens_neox': 606, 'n_words': 124}