From 73f5b02b4fa275bbd3a5880144114ea69f594307 Mon Sep 17 00:00:00 2001 From: Douglas Barbosa Alexandre Date: Mon, 3 Jul 2017 14:37:20 -0300 Subject: Change the force flag to a keyword argument --- app/models/project.rb | 4 ++-- spec/models/project_spec.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/project.rb b/app/models/project.rb index 21f4a18ec4a..fdf72d3bbd3 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -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? diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 0eeaf68a02a..1a56f6f5c59 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -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 -- cgit v1.2.1