Commit c1827f1c authored by Stan Hu's avatar Stan Hu

API: Fix recursive flag not working with Rugged get_tree_entries flag

Attempting to use the API endpoint
/projects/:id/repository/tree?recursive=true would only return a subset
of the results since the full recursive list wasn't actually being
returned.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/61979
parent cddf9b87
---
title: Fix Rugged get_tree_entries recursive flag not working
merge_request: 28494
author:
type: fixed
......@@ -43,6 +43,8 @@ module Gitlab
ordered_entries.concat(tree_entries_from_rugged(repository, sha, entry.path, true))
end
end
ordered_entries
end
def rugged_populate_flat_path(repository, sha, path, entries)
......
......@@ -19,7 +19,9 @@ 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 >= 5
expect(entries.map(&:path)).to include('files/html',
'files/markdown/ruby-style-guide.md')
expect(entries.count).to be >= 10
expect(entries).to all(be_a(Gitlab::Git::Tree))
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