diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-10-30 16:17:36 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-10-30 16:17:36 +0200 |
commit | f0dd16d53e81bb0796fa6fa422efcab8a64f097a (patch) | |
tree | 8d583e1e96b1e82334d185d9252e22842fe36689 /lib/api/entities.rb | |
parent | 8388bbe82918d2fca2600620f48e048ccfab2c97 (diff) | |
parent | c2f0ae8a40658d02dfa128881a014fe1e907f61c (diff) | |
download | gitlab-ce-f0dd16d53e81bb0796fa6fa422efcab8a64f097a.tar.gz |
Merge branch 'master' of github.com:gitlabhq/gitlabhq
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Conflicts:
CHANGELOG
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r-- | lib/api/entities.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 80e9470195e..d19caf5b23a 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -73,6 +73,25 @@ module API end end + class RepoTag < Grape::Entity + expose :name + expose :message do |repo_obj, _options| + if repo_obj.respond_to?(:message) + repo_obj.message + else + nil + end + end + + expose :commit do |repo_obj, options| + if repo_obj.respond_to?(:commit) + repo_obj.commit + elsif options[:project] + options[:project].repository.commit(repo_obj.target) + end + end + end + class RepoObject < Grape::Entity expose :name |