identifier-check.patch
config/locales/en.yml (working copy) | ||
---|---|---|
23 | 23 |
messages: |
24 | 24 |
should_be_of_format_local: should be of format "%{repository_format}" |
25 | 25 |
already_exists: already exists |
26 |
name_mismatch: Mismatch between repository identifier and path |
|
26 | 27 |
scm_not_supported: This SCM is not supported |
27 | 28 |
repository_exists_for_identifier: Repository already exists for this project identifier |
28 | 29 |
scm_repositories_maximum_count_exceeded: Maximum count (%{max}) of repositories exceeded |
lib/scm_repositories_controller_patch.rb (working copy) | ||
---|---|---|
237 | 237 |
path = interface.default_path(name) |
238 | 238 |
if interface.repository_exists?(name) |
239 | 239 |
repository.errors.add(:url, :already_exists) |
240 |
elsif (repository.identifier.present? and name != repository.project.identifier + "." + repository.identifier) or |
|
241 |
(not repository.identifier.present? and name != repository.project.identifier) |
|
242 |
repository.errors.add(:base, :name_mismatch) |
|
240 | 243 |
else |
241 | 244 |
Rails.logger.info "Creating reporitory: #{path}" |
242 | 245 |
interface.execute(ScmConfig['pre_create'], path, @project) if ScmConfig['pre_create'] |