Project

General

Profile

Defect #13592 ยป fix-not-unique.patch

Prepend underscores before non-unique commit SHA-1s - Griffin Smith, 2013-03-25 23:44

View differences:

app/models/repository.rb
serialize :extra_info
before_create :check_identifier
before_save :check_default
# Raw SQL to delete changesets and changes in the database
......
protected
def check_identifier
while self.exists?(:conditions => {:identifier => self.identifier})
self.identifier = "_" + self.identifier
end
end
def check_default
if !is_default? && set_as_default?
self.is_default = true
    (1-1/1)