diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-20 13:43:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-20 13:43:29 +0300 |
commit | 3b1af5cc7ed2666ff18b718ce5d30fa5a2756674 (patch) | |
tree | 3bc4a40e0ee51ec27eabf917c537033c0c5b14d4 /app/graphql/resolvers/tree_resolver.rb | |
parent | 9bba14be3f2c211bf79e15769cd9b77bc73a13bc (diff) |
Add latest changes from gitlab-org/gitlab@16-1-stable-eev16.1.0-rc42
Diffstat (limited to 'app/graphql/resolvers/tree_resolver.rb')
-rw-r--r-- | app/graphql/resolvers/tree_resolver.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/graphql/resolvers/tree_resolver.rb b/app/graphql/resolvers/tree_resolver.rb index 553f9aa6cd9..6b88f120d1b 100644 --- a/app/graphql/resolvers/tree_resolver.rb +++ b/app/graphql/resolvers/tree_resolver.rb @@ -17,14 +17,18 @@ module Resolvers argument :ref, GraphQL::Types::String, required: false, description: 'Commit ref to get the tree for. Default value is HEAD.' + argument :ref_type, Types::RefTypeEnum, + required: false, + description: 'Type of ref.' alias_method :repository, :object def resolve(**args) return unless repository.exists? - args[:ref] ||= :head - repository.tree(args[:ref], args[:path], recursive: args[:recursive]) + ref = (args[:ref].presence || :head) + + repository.tree(ref, args[:path], recursive: args[:recursive], ref_type: args[:ref_type]) end end end |