diff options
author | Sean McGivern <sean@gitlab.com> | 2019-02-19 10:31:33 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2019-02-19 10:31:33 +0000 |
commit | b166398307a2faf114bbaf5e039601371a6cf1e9 (patch) | |
tree | 22f4fb2d4a8acdad665743fc616a7cd831a59052 /app/serializers | |
parent | 5ff775fdef99eeec1f25bea7baf5480fa402f714 (diff) | |
parent | 178daffe708685d56cc618206153eb2a16cdf741 (diff) | |
download | gitlab-ce-b166398307a2faf114bbaf5e039601371a6cf1e9.tar.gz |
Merge branch '38261-remove-unused-code' into 'master'
Remove two unused formats from Projects::TreeController#show
Closes #38261
See merge request gitlab-org/gitlab-ce!25249
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/tree_entity.rb | 15 | ||||
-rw-r--r-- | app/serializers/tree_root_entity.rb | 27 | ||||
-rw-r--r-- | app/serializers/tree_serializer.rb | 5 |
3 files changed, 0 insertions, 47 deletions
diff --git a/app/serializers/tree_entity.rb b/app/serializers/tree_entity.rb deleted file mode 100644 index 9b7dc80e1d9..00000000000 --- a/app/serializers/tree_entity.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class TreeEntity < Grape::Entity - include RequestAwareEntity - - expose :id, :path, :name, :mode - - expose :icon do |tree| - IconsHelper.file_type_icon_class('folder', tree.mode, tree.name) - end - - expose :url do |tree| - project_tree_path(request.project, File.join(request.ref, tree.path)) - end -end diff --git a/app/serializers/tree_root_entity.rb b/app/serializers/tree_root_entity.rb deleted file mode 100644 index f1cfcd943d8..00000000000 --- a/app/serializers/tree_root_entity.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -# TODO: Inherit from TreeEntity, when `Tree` implements `id` and `name` like `Gitlab::Git::Tree`. -class TreeRootEntity < Grape::Entity - include RequestAwareEntity - - expose :path - - expose :trees, using: TreeEntity - expose :blobs, using: BlobEntity - expose :submodules, using: SubmoduleEntity - - expose :parent_tree_url do |tree| - path = tree.path.sub(%r{\A/}, '') - next unless path.present? - - path_segments = path.split('/') - path_segments.pop - parent_tree_path = path_segments.join('/') - - project_tree_path(request.project, File.join(request.ref, parent_tree_path)) - end - - expose :last_commit_path do |tree| - logs_file_project_ref_path(request.project, request.ref, tree.path) - end -end diff --git a/app/serializers/tree_serializer.rb b/app/serializers/tree_serializer.rb deleted file mode 100644 index 536b8ab1ae2..00000000000 --- a/app/serializers/tree_serializer.rb +++ /dev/null @@ -1,5 +0,0 @@ -# frozen_string_literal: true - -class TreeSerializer < BaseSerializer - entity TreeRootEntity -end |