diff options
author | Ahmad Sherif <me@ahmadsherif.com> | 2017-10-12 13:32:17 +0200 |
---|---|---|
committer | Ahmad Sherif <me@ahmadsherif.com> | 2017-10-12 14:20:04 +0200 |
commit | a24abf39bf78226baaad03fe45caf416dbfc9b74 (patch) | |
tree | 0bd47cb0afa255020ddef8eacc8ae6ab348ab034 | |
parent | 4378f56c7b1f6f6031c284ff8879cdc4ad79468f (diff) | |
download | gitlab-ce-fix/rugged-alternate-paths.tar.gz |
Fix the format of rugged alternate directory listfix/rugged-alternate-paths
Fixes #39046
-rw-r--r-- | lib/gitlab/git/repository.rb | 1 | ||||
-rw-r--r-- | spec/lib/gitlab/git/repository_spec.rb | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index a082cfed706..86c29a15a3d 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -1230,6 +1230,7 @@ module Gitlab relative_paths.map { |d| File.join(path, d) } else Gitlab::Git::Env.all.values_at(*ALLOWED_OBJECT_DIRECTORIES_VARIABLES) + .flatten .compact .flat_map { |d| d.split(File::PATH_SEPARATOR) } end diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb index d959562c951..b82e5e6d000 100644 --- a/spec/lib/gitlab/git/repository_spec.rb +++ b/spec/lib/gitlab/git/repository_spec.rb @@ -87,7 +87,7 @@ describe Gitlab::Git::Repository, seed_helper: true do 'GIT_OBJECT_DIRECTORY_RELATIVE' => './objects/foo', 'GIT_ALTERNATE_OBJECT_DIRECTORIES_RELATIVE' => ['./objects/bar', './objects/baz'], 'GIT_OBJECT_DIRECTORY' => 'ignored', - 'GIT_ALTERNATE_OBJECT_DIRECTORIES' => 'ignored:ignored', + 'GIT_ALTERNATE_OBJECT_DIRECTORIES' => %w[ignored ignored], 'GIT_OTHER' => 'another_env' }) end @@ -104,7 +104,7 @@ describe Gitlab::Git::Repository, seed_helper: true do before do allow(Gitlab::Git::Env).to receive(:all).and_return({ 'GIT_OBJECT_DIRECTORY' => 'foo', - 'GIT_ALTERNATE_OBJECT_DIRECTORIES' => 'bar:baz', + 'GIT_ALTERNATE_OBJECT_DIRECTORIES' => %w[bar baz], 'GIT_OTHER' => 'another_env' }) end |