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
Kazuhiko Shiozaki
gitlab-ce
Commits
d793de7a
Commit
d793de7a
authored
Mar 18, 2015
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Commits in push data should always be an array.
parent
1667861e
Changes
1
Hide 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 @
d793de7a
...
...
@@ -28,6 +28,12 @@ module Gitlab
# Get latest 20 commits ASC
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"
# Hash to be passed as post_receive_data
data
=
{
...
...
@@ -49,17 +55,10 @@ module Gitlab
git_ssh_url:
project
.
ssh_url_to_repo
,
visibility_level:
project
.
visibility_level
},
commits:
[]
,
commits:
commit_attrs
,
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
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