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
68d7a3c5
Commit
68d7a3c5
authored
Nov 03, 2020
by
Ragnar-H
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make remaining_additional_purchased_storage natural number
parent
429836ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
ee/lib/ee/gitlab/repository_size_checker.rb
ee/lib/ee/gitlab/repository_size_checker.rb
+1
-1
ee/spec/lib/ee/gitlab/repository_size_checker_spec.rb
ee/spec/lib/ee/gitlab/repository_size_checker_spec.rb
+11
-0
No files found.
ee/lib/ee/gitlab/repository_size_checker.rb
View file @
68d7a3c5
...
@@ -48,7 +48,7 @@ module EE
...
@@ -48,7 +48,7 @@ module EE
end
end
def
remaining_additional_purchased_storage
def
remaining_additional_purchased_storage
additional_purchased_storage
-
total_excess_without_current_project
[
additional_purchased_storage
-
total_excess_without_current_project
,
0
].
max
end
end
end
end
end
end
...
...
ee/spec/lib/ee/gitlab/repository_size_checker_spec.rb
View file @
68d7a3c5
...
@@ -197,6 +197,17 @@ RSpec.describe Gitlab::RepositorySizeChecker do
...
@@ -197,6 +197,17 @@ RSpec.describe Gitlab::RepositorySizeChecker do
end
end
context
'without additional purchased storage'
do
context
'without additional purchased storage'
do
context
'when namespace has total_repository_size_excess but project is below limit'
do
let
(
:total_repository_size_excess
)
{
50
}
let
(
:change_size
)
{
1
.
megabyte
}
let
(
:limit
)
{
10
}
let
(
:current_size
)
{
5
}
it
'returns zero'
do
expect
(
subject
.
exceeded_size
(
change_size
)).
to
eq
(
0
)
end
end
include_examples
'checker size exceeded'
include_examples
'checker size exceeded'
end
end
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