Change the force flag to a keyword argument

parent 9c8075c4
......@@ -1073,7 +1073,7 @@ class Project < ActiveRecord::Base
merge_requests.where(source_project_id: self.id)
end
def create_repository(force = false)
def create_repository(force: false)
# Forked import is handled asynchronously
return if forked? && !force
......@@ -1087,7 +1087,7 @@ class Project < ActiveRecord::Base
end
def ensure_repository
create_repository(true) unless repository_exists?
create_repository(force: true) unless repository_exists?
end
def repository_exists?
......
......@@ -1344,7 +1344,7 @@ describe Project, models: true do
.with(project.repository_storage_path, project.path_with_namespace)
.and_return(true)
expect(project).to receive(:create_repository)
expect(project).to receive(:create_repository).with(force: true)
project.ensure_repository
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment