summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2017-10-12 15:37:14 +0000
committerDouwe Maan <douwe@gitlab.com>2017-10-12 15:37:14 +0000
commit05f46b820ee607715a9c23beabd98553d64556e0 (patch)
tree8b7be78ac1e00210b2b8096d23c525ecf6a1cf1a
parentaf3c98bb93ede723f305477122bfdce927066307 (diff)
parenta24abf39bf78226baaad03fe45caf416dbfc9b74 (diff)
downloadgitlab-ce-05f46b820ee607715a9c23beabd98553d64556e0.tar.gz
Merge branch 'fix/rugged-alternate-paths' into 'master'
Fix the format of rugged alternate directory list Closes #39046 See merge request gitlab-org/gitlab-ce!14840
-rw-r--r--lib/gitlab/git/repository.rb1
-rw-r--r--spec/lib/gitlab/git/repository_spec.rb4
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb
index 5b9c42ef586..a6b2d189f18 100644
--- a/lib/gitlab/git/repository.rb
+++ b/lib/gitlab/git/repository.rb
@@ -1236,6 +1236,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 1b7486eaea1..b11fa38856b 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