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
e145f46a
Unverified
Commit
e145f46a
authored
Sep 30, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix contributors api
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
57c0d9ec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
+6
-8
repository.rb
app/models/repository.rb
+4
-6
repositories_spec.rb
spec/requests/api/repositories_spec.rb
+2
-2
No files found.
app/models/repository.rb
View file @
e145f46a
...
...
@@ -250,20 +250,18 @@ class Repository
end
def
contributors
log
=
graph_log
.
group_by
{
|
i
|
i
[
:author_email
]
}
commits
=
self
.
commits
(
nil
,
nil
,
2000
,
0
,
true
)
log
.
map
do
|
email
,
contribution
s
|
commits
.
group_by
(
&
:author_email
).
map
do
|
email
,
commit
s
|
contributor
=
Gitlab
::
Contributor
.
new
contributor
.
email
=
email
co
ntributions
.
each
do
|
contribution
|
co
mmits
.
each
do
|
commit
|
if
contributor
.
name
.
blank?
contributor
.
name
=
co
ntribution
[
:author_name
]
contributor
.
name
=
co
mmit
.
author_name
end
contributor
.
commits
+=
1
contributor
.
additions
+=
contribution
[
:additions
]
||
0
contributor
.
deletions
+=
contribution
[
:deletions
]
||
0
end
contributor
...
...
spec/requests/api/repositories_spec.rb
View file @
e145f46a
...
...
@@ -224,8 +224,8 @@ describe API::API, api: true do
contributor
[
'email'
].
should
==
'dmitriy.zaporozhets@gmail.com'
contributor
[
'name'
].
should
==
'Dmitriy Zaporozhets'
contributor
[
'commits'
].
should
==
13
contributor
[
'additions'
].
should
==
4081
contributor
[
'deletions'
].
should
==
29
contributor
[
'additions'
].
should
==
0
contributor
[
'deletions'
].
should
==
0
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