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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
9abb9800
Commit
9abb9800
authored
Dec 12, 2018
by
Zeger-Jan van de Weg
Committed by
Nick Thomas
Dec 12, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix creation query for pools repository
parent
b9ccf013
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
3 deletions
+26
-3
app/models/project.rb
app/models/project.rb
+3
-3
spec/models/project_spec.rb
spec/models/project_spec.rb
+23
-0
No files found.
app/models/project.rb
View file @
9abb9800
...
...
@@ -2014,12 +2014,12 @@ class Project < ActiveRecord::Base
def
create_new_pool_repository
pool
=
begin
create_
or_find_
pool_repository!
(
shard:
Shard
.
by_name
(
repository_storage
),
source_project:
self
)
create_pool_repository!
(
shard:
Shard
.
by_name
(
repository_storage
),
source_project:
self
)
rescue
ActiveRecord
::
RecordNotUnique
retry
pool_repository
(
true
)
end
pool
.
schedule
pool
.
schedule
unless
pool
.
scheduled?
pool
end
...
...
spec/models/project_spec.rb
View file @
9abb9800
...
...
@@ -4102,6 +4102,29 @@ describe Project do
end
end
describe
'#object_pool_params'
do
let
(
:project
)
{
create
(
:project
,
:repository
,
:public
)
}
subject
{
project
.
object_pool_params
}
before
do
stub_application_setting
(
hashed_storage_enabled:
true
)
end
context
'when the objects cannot be pooled'
do
let
(
:project
)
{
create
(
:project
,
:repository
,
:private
)
}
it
{
is_expected
.
to
be_empty
}
end
context
'when a pool is created'
do
it
'returns that pool repository'
do
expect
(
subject
).
not_to
be_empty
expect
(
subject
[
:pool_repository
]).
to
be_persisted
end
end
end
describe
'#git_objects_poolable?'
do
subject
{
project
}
...
...
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