summaryrefslogtreecommitdiff
path: root/app/serializers/tree_entity.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/serializers/tree_entity.rb')
-rw-r--r--app/serializers/tree_entity.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/serializers/tree_entity.rb b/app/serializers/tree_entity.rb
index 555e5cf83bd..5cda5997642 100644
--- a/app/serializers/tree_entity.rb
+++ b/app/serializers/tree_entity.rb
@@ -3,8 +3,8 @@ class TreeEntity < Grape::Entity
expose :id, :path, :name, :mode
- expose :last_commit do |tree|
- request.project.repository.last_commit_for_path(tree.commit_id, tree.path)
+ expose :last_commit, using: CommitEntity do |tree|
+ request.project.repository.last_commit_for_path(request.commit.id, tree.path)
end
expose :icon do |tree|