Skip to content
Snippets Groups Projects
Commit 73f5b02b authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre
Browse files

Change the force flag to a keyword argument

parent 9c8075c4
No related branches found
No related tags found
No related merge requests found
Loading
@@ -1073,7 +1073,7 @@ class Project < ActiveRecord::Base
Loading
@@ -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
   
Loading
@@ -1087,7 +1087,7 @@ class Project < ActiveRecord::Base
Loading
@@ -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?
Loading
Loading
Loading
@@ -1344,7 +1344,7 @@ describe Project, models: true do
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment