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
Boxiang Sun
gitlab-ce
Commits
da769135
Commit
da769135
authored
Aug 22, 2017
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rubocop whitespace
parent
c47b947a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
lib/gitlab/git/committer.rb
lib/gitlab/git/committer.rb
+1
-1
lib/gitlab/git/hooks_service.rb
lib/gitlab/git/hooks_service.rb
+7
-8
No files found.
lib/gitlab/git/committer.rb
View file @
da769135
...
@@ -2,7 +2,7 @@ module Gitlab
...
@@ -2,7 +2,7 @@ module Gitlab
module
Git
module
Git
class
Committer
class
Committer
attr_reader
:name
,
:email
,
:gl_id
attr_reader
:name
,
:email
,
:gl_id
def
self
.
from_user
(
user
)
def
self
.
from_user
(
user
)
new
(
user
.
name
,
user
.
email
,
Gitlab
::
GlId
.
gl_id
(
user
))
new
(
user
.
name
,
user
.
email
,
Gitlab
::
GlId
.
gl_id
(
user
))
end
end
...
...
lib/gitlab/git/hooks_service.rb
View file @
da769135
...
@@ -2,31 +2,31 @@ module Gitlab
...
@@ -2,31 +2,31 @@ module Gitlab
module
Git
module
Git
class
HooksService
class
HooksService
PreReceiveError
=
Class
.
new
(
StandardError
)
PreReceiveError
=
Class
.
new
(
StandardError
)
attr_accessor
:oldrev
,
:newrev
,
:ref
attr_accessor
:oldrev
,
:newrev
,
:ref
def
execute
(
committer
,
repository
,
oldrev
,
newrev
,
ref
)
def
execute
(
committer
,
repository
,
oldrev
,
newrev
,
ref
)
@repository
=
repository
@repository
=
repository
@gl_id
=
committer
.
gl_id
@gl_id
=
committer
.
gl_id
@oldrev
=
oldrev
@oldrev
=
oldrev
@newrev
=
newrev
@newrev
=
newrev
@ref
=
ref
@ref
=
ref
%w(pre-receive update)
.
each
do
|
hook_name
|
%w(pre-receive update)
.
each
do
|
hook_name
|
status
,
message
=
run_hook
(
hook_name
)
status
,
message
=
run_hook
(
hook_name
)
unless
status
unless
status
raise
PreReceiveError
,
message
raise
PreReceiveError
,
message
end
end
end
end
yield
(
self
).
tap
do
yield
(
self
).
tap
do
run_hook
(
'post-receive'
)
run_hook
(
'post-receive'
)
end
end
end
end
private
private
def
run_hook
(
name
)
def
run_hook
(
name
)
hook
=
Gitlab
::
Git
::
Hook
.
new
(
name
,
@repository
)
hook
=
Gitlab
::
Git
::
Hook
.
new
(
name
,
@repository
)
hook
.
trigger
(
@gl_id
,
oldrev
,
newrev
,
ref
)
hook
.
trigger
(
@gl_id
,
oldrev
,
newrev
,
ref
)
...
@@ -34,4 +34,3 @@ module Gitlab
...
@@ -34,4 +34,3 @@ module Gitlab
end
end
end
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