BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
7c7b2041
Commit
7c7b2041
authored
Jan 18, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '26773-fix-project-statistics-repository-size' into 'master'
Resolve "Wrong file size on repository page" Closes #26773 See merge request !8616
parents
52e652cb
4bb3675b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
+7
-2
project_statistics.rb
app/models/project_statistics.rb
+2
-1
26773-fix-project-statistics-repository-size.yml
...released/26773-fix-project-statistics-repository-size.yml
+4
-0
project_statistics_spec.rb
spec/models/project_statistics_spec.rb
+1
-1
No files found.
app/models/project_statistics.rb
View file @
7c7b2041
...
...
@@ -25,8 +25,9 @@ class ProjectStatistics < ActiveRecord::Base
self
.
commit_count
=
project
.
repository
.
commit_count
end
# Repository#size needs to be converted from MB to Byte.
def
update_repository_size
self
.
repository_size
=
project
.
repository
.
size
self
.
repository_size
=
project
.
repository
.
size
*
1
.
megabyte
end
def
update_lfs_objects_size
...
...
changelogs/unreleased/26773-fix-project-statistics-repository-size.yml
0 → 100644
View file @
7c7b2041
---
title
:
Adjust ProjectStatistic#repository_size with values saved as MB
merge_request
:
8616
author
:
spec/models/project_statistics_spec.rb
View file @
7c7b2041
...
...
@@ -107,7 +107,7 @@ describe ProjectStatistics, models: true do
describe
'#update_repository_size'
do
before
do
allow
(
project
.
repository
).
to
receive
(
:size
).
and_return
(
12
.
megabytes
)
allow
(
project
.
repository
).
to
receive
(
:size
).
and_return
(
12
)
statistics
.
update_repository_size
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