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
0
Merge Requests
0
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
iv
gitlab-ce
Commits
9e0715c0
Commit
9e0715c0
authored
Mar 19, 2015
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '7-9-stable' of dev.gitlab.org:gitlab/gitlabhq into 7-9-stable
parents
ab83fb99
91c65d03
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
lib/gitlab/push_data_builder.rb
lib/gitlab/push_data_builder.rb
+7
-8
No files found.
lib/gitlab/push_data_builder.rb
View file @
9e0715c0
...
@@ -28,6 +28,12 @@ module Gitlab
...
@@ -28,6 +28,12 @@ module Gitlab
# Get latest 20 commits ASC
# Get latest 20 commits ASC
commits_limited
=
commits
.
last
(
20
)
commits_limited
=
commits
.
last
(
20
)
# For performance purposes maximum 20 latest commits
# will be passed as post receive hook data.
commit_attrs
=
commits_limited
.
map
do
|
commit
|
commit
.
hook_attrs
(
project
)
end
type
=
Gitlab
::
Git
.
tag_ref?
(
ref
)
?
"tag_push"
:
"push"
type
=
Gitlab
::
Git
.
tag_ref?
(
ref
)
?
"tag_push"
:
"push"
# Hash to be passed as post_receive_data
# Hash to be passed as post_receive_data
data
=
{
data
=
{
...
@@ -49,17 +55,10 @@ module Gitlab
...
@@ -49,17 +55,10 @@ module Gitlab
git_ssh_url:
project
.
ssh_url_to_repo
,
git_ssh_url:
project
.
ssh_url_to_repo
,
visibility_level:
project
.
visibility_level
visibility_level:
project
.
visibility_level
},
},
commits:
[]
,
commits:
commit_attrs
,
total_commits_count:
commits_count
total_commits_count:
commits_count
}
}
# For performance purposes maximum 20 latest commits
# will be passed as post receive hook data.
commits_limited
.
each
do
|
commit
|
data
[
:commits
]
<<
commit
.
hook_attrs
(
project
)
end
data
[
:commits
]
=
""
if
data
[
:commits
].
count
==
0
data
data
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