diff options
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r-- | lib/api/entities.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 457af52fe9d..6bad6c74bca 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -194,5 +194,30 @@ module API class Label < Grape::Entity expose :name end + + class RepoDiff < Grape::Entity + expose :old_path, :new_path, :a_mode, :b_mode, :diff + expose :new_file, :renamed_file, :deleted_file + end + + class Compare < Grape::Entity + expose :commit, using: Entities::RepoCommit do |compare, options| + if compare.commit + Commit.new compare.commit + end + end + expose :commits, using: Entities::RepoCommit do |compare, options| + Commit.decorate compare.commits + end + expose :diffs, using: Entities::RepoDiff do |compare, options| + compare.diffs + end + + expose :compare_timeout do |compare, options| + compare.timeout + end + + expose :same, as: :compare_same_ref + end end end |