Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/ruby
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2019-03-14 20:03:02 +0300
committerPaul Okstad <pokstad@gitlab.com>2019-03-14 20:03:02 +0300
commit49c66f0eaa1410dc0ae6d6687d1ea1baecfd6aa4 (patch)
tree53087cf8b6c04f6004308ee127d94027f2e5f2c0 /ruby
parent3332ebac578e042257036dab1c96aa1463082e75 (diff)
Revert "Revert "Merge branch 'switch-to-embedded-hooks' into 'master'""
This reverts commit 4f376cf16e64a0fa673821c0eb4a56eca9ca9419.
Diffstat (limited to 'ruby')
-rw-r--r--ruby/lib/gitlab/git/hook.rb4
-rw-r--r--ruby/lib/gitlab/git/repository.rb7
-rw-r--r--ruby/spec/lib/gitlab/git/repository_spec.rb2
3 files changed, 8 insertions, 5 deletions
diff --git a/ruby/lib/gitlab/git/hook.rb b/ruby/lib/gitlab/git/hook.rb
index 1b2979cc2..222c93d3b 100644
--- a/ruby/lib/gitlab/git/hook.rb
+++ b/ruby/lib/gitlab/git/hook.rb
@@ -7,6 +7,10 @@ module Gitlab
Gitlab.config.git.hooks_directory
end
+ def self.legacy_hooks_directory
+ File.join(Gitlab.config.gitlab_shell.path, 'hooks')
+ end
+
GL_PROTOCOL = 'web'
attr_reader :name, :path, :repository
diff --git a/ruby/lib/gitlab/git/repository.rb b/ruby/lib/gitlab/git/repository.rb
index 6f4bd9910..1a0b7d044 100644
--- a/ruby/lib/gitlab/git/repository.rb
+++ b/ruby/lib/gitlab/git/repository.rb
@@ -62,10 +62,9 @@ module Gitlab
repo = Rugged::Repository.init_at(repo_path, true)
repo.close
- # TODO: remove this when self healing hooks has been merged at least
- # one release ago: https://gitlab.com/gitlab-org/gitaly/merge_requests/886
- symlink_hooks_to = Gitlab::Git::Hook.directory
- create_hooks(repo_path, symlink_hooks_to) if symlink_hooks_to.present?
+ # TODO: stop symlinking to the old hooks location in or after GitLab 12.0.
+ # https://gitlab.com/gitlab-org/gitaly/issues/1392
+ create_hooks(repo_path, Gitlab::Git::Hook.legacy_hooks_directory)
end
def create_hooks(repo_path, global_hooks_path)
diff --git a/ruby/spec/lib/gitlab/git/repository_spec.rb b/ruby/spec/lib/gitlab/git/repository_spec.rb
index 677be7aa9..4364b8818 100644
--- a/ruby/spec/lib/gitlab/git/repository_spec.rb
+++ b/ruby/spec/lib/gitlab/git/repository_spec.rb
@@ -40,7 +40,7 @@ describe Gitlab::Git::Repository do # rubocop:disable Metrics/BlockLength
describe '.create_hooks' do
let(:repo_path) { File.join(storage_path, 'hook-test.git') }
let(:hooks_dir) { File.join(repo_path, 'hooks') }
- let(:target_hooks_dir) { Gitlab::Git::Hook.directory }
+ let(:target_hooks_dir) { Gitlab::Git::Hook.legacy_hooks_directory }
let(:existing_target) { File.join(repo_path, 'foobar') }
before do