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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-04-01 08:00:19 +0300
committerStan Hu <stanhu@gmail.com>2019-04-01 08:14:19 +0300
commit8686e01250824e475dc9412c399c44100878a71e (patch)
treed64e4bb83c18177a5c97eb19d2483ccd1c024c8e /spec/lib/gitlab/git/tree_spec.rb
parentafbc827465e6fc0e4eec1308e34637bcd317eb52 (diff)
Avoid excessive recursive calls with Rugged TreeEntries
The Rugged implementation was recursively scanning the repository to create `flat_path` because the post-process step was being called from with a loop. For large repositories, this was significantly slowing things down. Break the call to `rugged_populate_flat_path` out of this loop to make this work efficiently. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/59759
Diffstat (limited to 'spec/lib/gitlab/git/tree_spec.rb')
-rw-r--r--spec/lib/gitlab/git/tree_spec.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/lib/gitlab/git/tree_spec.rb b/spec/lib/gitlab/git/tree_spec.rb
index 60060c41616..7ad3cde97f8 100644
--- a/spec/lib/gitlab/git/tree_spec.rb
+++ b/spec/lib/gitlab/git/tree_spec.rb
@@ -19,7 +19,7 @@ describe Gitlab::Git::Tree, :seed_helper do
it 'returns a list of tree objects' do
entries = described_class.where(repository, SeedRepo::Commit::ID, 'files', true)
- expect(entries.count).to be > 10
+ expect(entries.count).to be >= 5
expect(entries).to all(be_a(Gitlab::Git::Tree))
end