Commit a577d7be authored by Stan Hu's avatar Stan Hu

Merge branch 'ph/fixRuggedTagTreeError' into 'master'

Fix GraphQL tree query erroring when using tags

See merge request gitlab-org/gitlab!25923
parents da9e55a0 38a02976
......@@ -70,7 +70,7 @@ module Gitlab
# Lookup for rugged object by oid or ref name
def lookup(oid_or_ref_name)
rugged.rev_parse(oid_or_ref_name)
rev_parse_target(oid_or_ref_name)
end
end
end
......
......@@ -2381,7 +2381,7 @@ describe Repository do
end
end
describe '#tree' do
shared_examples '#tree' do
context 'using a non-existing repository' do
before do
allow(repository).to receive(:head_commit).and_return(nil)
......@@ -2399,10 +2399,17 @@ describe Repository do
context 'using an existing repository' do
it 'returns a Tree' do
expect(repository.tree(:head)).to be_an_instance_of(Tree)
expect(repository.tree('v1.1.1')).to be_an_instance_of(Tree)
end
end
end
it_behaves_like '#tree'
describe '#tree? with Rugged enabled', :enable_rugged do
it_behaves_like '#tree'
end
describe '#size' do
context 'with a non-existing repository' do
it 'returns 0' do
......
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