Commit da769135 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Rubocop whitespace

parent c47b947a
......@@ -2,7 +2,7 @@ module Gitlab
module Git
class Committer
attr_reader :name, :email, :gl_id
def self.from_user(user)
new(user.name, user.email, Gitlab::GlId.gl_id(user))
end
......
......@@ -2,31 +2,31 @@ module Gitlab
module Git
class HooksService
PreReceiveError = Class.new(StandardError)
attr_accessor :oldrev, :newrev, :ref
def execute(committer, repository, oldrev, newrev, ref)
@repository = repository
@gl_id = committer.gl_id
@oldrev = oldrev
@newrev = newrev
@ref = ref
%w(pre-receive update).each do |hook_name|
status, message = run_hook(hook_name)
unless status
raise PreReceiveError, message
end
end
yield(self).tap do
run_hook('post-receive')
end
end
private
def run_hook(name)
hook = Gitlab::Git::Hook.new(name, @repository)
hook.trigger(@gl_id, oldrev, newrev, ref)
......@@ -34,4 +34,3 @@ module Gitlab
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment