Project

General

Profile

Actions

Defect #19260

closed

Non-default identifier-less git repositories are undeletable

Added by Felix Schäfer over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Category:
Administration
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Git repositories without an identifier that are not default (because another repository in the project has been promoted as default) are not deletable. This was tested on 2.3 and 2.5, but the code seems to still be in use in current trunk.

This is due to http://www.redmine.org/projects/redmine/repository/entry/branches/2.6-stable/app/models/repository.rb#L41 preventing successful saving in http://www.redmine.org/projects/redmine/repository/entry/branches/2.6-stable/app/models/repository/git.rb#L254 and makes the before_destroy in repository.rb fail.

I'm not quite sure what the intent of the validation was, I guess to enforce that if there is a repository with no identifier it is the default, but it seems possible to work around that after the creation of the identifier-less repository.

Attached is a patch with a failing test, the test passes with the validation removed, and removing the validation causes no other tests to fail.


Files

repo_identifiers.diff (2.09 KB) repo_identifiers.diff Felix Schäfer, 2015-03-03 18:15
Actions

Also available in: Atom PDF