Index: config/locales/en.yml =================================================================== --- config/locales/en.yml (revision 142) +++ config/locales/en.yml (working copy) @@ -23,6 +23,7 @@ messages: should_be_of_format_local: should be of format "%{repository_format}" already_exists: already exists + name_mismatch: Mismatch between repository identifier and path scm_not_supported: This SCM is not supported repository_exists_for_identifier: Repository already exists for this project identifier scm_repositories_maximum_count_exceeded: Maximum count (%{max}) of repositories exceeded Index: lib/scm_repositories_controller_patch.rb =================================================================== --- lib/scm_repositories_controller_patch.rb (revision 142) +++ lib/scm_repositories_controller_patch.rb (working copy) @@ -237,6 +237,9 @@ path = interface.default_path(name) if interface.repository_exists?(name) repository.errors.add(:url, :already_exists) + elsif (repository.identifier.present? and name != repository.project.identifier + "." + repository.identifier) or + (not repository.identifier.present? and name != repository.project.identifier) + repository.errors.add(:base, :name_mismatch) else Rails.logger.info "Creating reporitory: #{path}" interface.execute(ScmConfig['pre_create'], path, @project) if ScmConfig['pre_create']