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
diff options
context:
space:
mode:
authorJohn Cai <jcai@gitlab.com>2020-03-18 21:59:12 +0300
committerJohn Cai <jcai@gitlab.com>2020-03-18 21:59:12 +0300
commit1b7629e1c76556e0e216784deebb989b43169d62 (patch)
tree2195f60ffa7570affdeb5af237f32f9eff3f7ea2
parentb06222c4123014643e5448afe2a041ecba487972 (diff)
parent1ce613790b4b030406b520345fdcf8c915039cc6 (diff)
Merge branch 'sh-simplify-gitaly-require' into 'master'
Simplify loading of required Ruby files See merge request gitlab-org/gitaly!1942
-rw-r--r--changelogs/unreleased/sh-simplify-gitaly-require.yml5
-rw-r--r--ruby/lib/gitlab/git.rb8
2 files changed, 7 insertions, 6 deletions
diff --git a/changelogs/unreleased/sh-simplify-gitaly-require.yml b/changelogs/unreleased/sh-simplify-gitaly-require.yml
new file mode 100644
index 000000000..f39db091c
--- /dev/null
+++ b/changelogs/unreleased/sh-simplify-gitaly-require.yml
@@ -0,0 +1,5 @@
+---
+title: Simplify loading of required Ruby files
+merge_request: 1942
+author:
+type: other
diff --git a/ruby/lib/gitlab/git.rb b/ruby/lib/gitlab/git.rb
index b0e87ff75..ed09fb894 100644
--- a/ruby/lib/gitlab/git.rb
+++ b/ruby/lib/gitlab/git.rb
@@ -16,11 +16,7 @@ require_relative 'rails_logger.rb'
require_relative 'gollum.rb'
require_relative 'config.rb'
-# `Dir.glob` will make a readdir() system call to extract the canonical
-# name of the directory. This will ensure we avoid errors with
-# substitutions below on case-sensitive filesystems such as Apple File
-# System.
-dir = Dir[__dir__].first
+dir = __dir__
# Some later requires are order-sensitive. Manually require whatever we need.
require_relative "#{dir}/encoding_helper.rb"
@@ -32,7 +28,7 @@ require_relative "#{dir}/git/repository_mirroring.rb"
# Require all .rb files we can find in the gitlab lib directory
Dir["#{dir}/**/*.rb"].sort.each do |ruby_file|
- require_relative ruby_file.sub(dir, '').sub(%r{^/*}, '')
+ require File.expand_path(ruby_file)
end
class String