Commit a24abf39 authored by Ahmad Sherif's avatar Ahmad Sherif

Fix the format of rugged alternate directory list

Fixes #39046
parent 4378f56c
...@@ -1230,6 +1230,7 @@ module Gitlab ...@@ -1230,6 +1230,7 @@ module Gitlab
relative_paths.map { |d| File.join(path, d) } relative_paths.map { |d| File.join(path, d) }
else else
Gitlab::Git::Env.all.values_at(*ALLOWED_OBJECT_DIRECTORIES_VARIABLES) Gitlab::Git::Env.all.values_at(*ALLOWED_OBJECT_DIRECTORIES_VARIABLES)
.flatten
.compact .compact
.flat_map { |d| d.split(File::PATH_SEPARATOR) } .flat_map { |d| d.split(File::PATH_SEPARATOR) }
end end
......
...@@ -87,7 +87,7 @@ describe Gitlab::Git::Repository, seed_helper: true do ...@@ -87,7 +87,7 @@ describe Gitlab::Git::Repository, seed_helper: true do
'GIT_OBJECT_DIRECTORY_RELATIVE' => './objects/foo', 'GIT_OBJECT_DIRECTORY_RELATIVE' => './objects/foo',
'GIT_ALTERNATE_OBJECT_DIRECTORIES_RELATIVE' => ['./objects/bar', './objects/baz'], 'GIT_ALTERNATE_OBJECT_DIRECTORIES_RELATIVE' => ['./objects/bar', './objects/baz'],
'GIT_OBJECT_DIRECTORY' => 'ignored', 'GIT_OBJECT_DIRECTORY' => 'ignored',
'GIT_ALTERNATE_OBJECT_DIRECTORIES' => 'ignored:ignored', 'GIT_ALTERNATE_OBJECT_DIRECTORIES' => %w[ignored ignored],
'GIT_OTHER' => 'another_env' 'GIT_OTHER' => 'another_env'
}) })
end end
...@@ -104,7 +104,7 @@ describe Gitlab::Git::Repository, seed_helper: true do ...@@ -104,7 +104,7 @@ describe Gitlab::Git::Repository, seed_helper: true do
before do before do
allow(Gitlab::Git::Env).to receive(:all).and_return({ allow(Gitlab::Git::Env).to receive(:all).and_return({
'GIT_OBJECT_DIRECTORY' => 'foo', 'GIT_OBJECT_DIRECTORY' => 'foo',
'GIT_ALTERNATE_OBJECT_DIRECTORIES' => 'bar:baz', 'GIT_ALTERNATE_OBJECT_DIRECTORIES' => %w[bar baz],
'GIT_OTHER' => 'another_env' 'GIT_OTHER' => 'another_env'
}) })
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment