Change the force flag to a keyword argument

parent 9c8075c4
...@@ -1073,7 +1073,7 @@ class Project < ActiveRecord::Base ...@@ -1073,7 +1073,7 @@ class Project < ActiveRecord::Base
merge_requests.where(source_project_id: self.id) merge_requests.where(source_project_id: self.id)
end end
def create_repository(force = false) def create_repository(force: false)
# Forked import is handled asynchronously # Forked import is handled asynchronously
return if forked? && !force return if forked? && !force
...@@ -1087,7 +1087,7 @@ class Project < ActiveRecord::Base ...@@ -1087,7 +1087,7 @@ class Project < ActiveRecord::Base
end end
def ensure_repository def ensure_repository
create_repository(true) unless repository_exists? create_repository(force: true) unless repository_exists?
end end
def repository_exists? def repository_exists?
......
...@@ -1344,7 +1344,7 @@ describe Project, models: true do ...@@ -1344,7 +1344,7 @@ describe Project, models: true do
.with(project.repository_storage_path, project.path_with_namespace) .with(project.repository_storage_path, project.path_with_namespace)
.and_return(true) .and_return(true)
expect(project).to receive(:create_repository) expect(project).to receive(:create_repository).with(force: true)
project.ensure_repository project.ensure_repository
end 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