From f441436e53377f207657ac0e0e518e5ee2b33a6c Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 26 May 2014 16:08:22 +0300 Subject: Add compare branches endpoint to API Signed-off-by: Dmitriy Zaporozhets --- lib/api/entities.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib/api/entities.rb') diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 457af52fe9d..eead8b18ebd 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -194,5 +194,22 @@ 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| + Commit.new compare.commit + 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 + end end end -- cgit v1.2.1