summaryrefslogtreecommitdiff
path: root/lib/gitlab/git/hook.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/git/hook.rb')
-rw-r--r--lib/gitlab/git/hook.rb17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/gitlab/git/hook.rb b/lib/gitlab/git/hook.rb
index 8f0c377ef4f..cc35d77c6e4 100644
--- a/lib/gitlab/git/hook.rb
+++ b/lib/gitlab/git/hook.rb
@@ -1,20 +1,23 @@
-# Gitaly note: JV: looks like this is only used by GitHooksService in
+# Gitaly note: JV: looks like this is only used by Gitlab::Git::HooksService in
# app/services. We shouldn't bother migrating this until we know how
-# GitHooksService will be migrated.
+# Gitlab::Git::HooksService will be migrated.
module Gitlab
module Git
class Hook
GL_PROTOCOL = 'web'.freeze
- attr_reader :name, :repo_path, :path
+ attr_reader :name, :path, :repository
- def initialize(name, project)
+ def initialize(name, repository)
@name = name
- @project = project
- @repo_path = project.repository.path
+ @repository = repository
@path = File.join(repo_path.strip, 'hooks', name)
end
+ def repo_path
+ repository.path
+ end
+
def exists?
File.exist?(path)
end
@@ -44,7 +47,7 @@ module Gitlab
'GL_ID' => gl_id,
'PWD' => repo_path,
'GL_PROTOCOL' => GL_PROTOCOL,
- 'GL_REPOSITORY' => Gitlab::GlRepository.gl_repository(@project, false)
+ 'GL_REPOSITORY' => repository.gl_repository
}
options = {