Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
73f5b02b
Commit
73f5b02b
authored
Jul 03, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change the force flag to a keyword argument
parent
9c8075c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
app/models/project.rb
app/models/project.rb
+2
-2
spec/models/project_spec.rb
spec/models/project_spec.rb
+1
-1
No files found.
app/models/project.rb
View file @
73f5b02b
...
@@ -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?
...
...
spec/models/project_spec.rb
View file @
73f5b02b
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment