summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2017-08-22 16:27:15 +0200
committerJacob Vosmaer <jacob@gitlab.com>2017-08-23 10:45:20 +0200
commitda769135fede9dececee8ab3e1f6951de7361e7f (patch)
tree4968905fba919433af3d4fcdb7bf149291489a9a
parentc47b947a7360f21cc1438462587c6e284b40e230 (diff)
downloadgitlab-ce-da769135fede9dececee8ab3e1f6951de7361e7f.tar.gz
Rubocop whitespace
-rw-r--r--lib/gitlab/git/committer.rb2
-rw-r--r--lib/gitlab/git/hooks_service.rb15
2 files changed, 8 insertions, 9 deletions
diff --git a/lib/gitlab/git/committer.rb b/lib/gitlab/git/committer.rb
index ef3576eaa1c..1f4bcf7a3a0 100644
--- a/lib/gitlab/git/committer.rb
+++ b/lib/gitlab/git/committer.rb
@@ -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
diff --git a/lib/gitlab/git/hooks_service.rb b/lib/gitlab/git/hooks_service.rb
index 1da92fcc0e2..ea8a87a1290 100644
--- a/lib/gitlab/git/hooks_service.rb
+++ b/lib/gitlab/git/hooks_service.rb
@@ -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
-