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
968ad4d7
Commit
968ad4d7
authored
Jan 18, 2017
by
Rémy Coutable
Committed by
James Lopez
Jan 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
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
parent
f32159d0
Show 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 @
968ad4d7
...
@@ -25,8 +25,9 @@ class ProjectStatistics < ActiveRecord::Base
...
@@ -25,8 +25,9 @@ class ProjectStatistics < ActiveRecord::Base
self
.
commit_count
=
project
.
repository
.
commit_count
self
.
commit_count
=
project
.
repository
.
commit_count
end
end
# Repository#size needs to be converted from MB to Byte.
def
update_repository_size
def
update_repository_size
self
.
repository_size
=
project
.
repository
.
size
self
.
repository_size
=
project
.
repository
.
size
*
1
.
megabyte
end
end
def
update_lfs_objects_size
def
update_lfs_objects_size
...
...
changelogs/unreleased/26773-fix-project-statistics-repository-size.yml
0 → 100644
View file @
968ad4d7
---
title
:
Adjust ProjectStatistic#repository_size with values saved as MB
merge_request
:
8616
author
:
spec/models/project_statistics_spec.rb
View file @
968ad4d7
...
@@ -107,7 +107,7 @@ describe ProjectStatistics, models: true do
...
@@ -107,7 +107,7 @@ describe ProjectStatistics, models: true do
describe
'#update_repository_size'
do
describe
'#update_repository_size'
do
before
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
statistics
.
update_repository_size
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