diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-10-03 14:37:19 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-10-03 14:37:19 +0400 |
commit | 03b44916ba08ac766bb6763882be5704dca5b4ea (patch) | |
tree | 4decccab9407271d1971f28aee7b201a83637cc7 /app/models/commit.rb | |
parent | 1c077cac8a70ada8eda4a099d5bee92950eeda5d (diff) | |
parent | 1c9d2e39c1aef8e10ebff6e57c174c197a3a1c93 (diff) |
Merge pull request #7754 from Bugagazavr/hooks
More information in merge request hook
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r-- | app/models/commit.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index 7f586ebe781..a1343b65c72 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -88,6 +88,21 @@ class Commit description.present? end + def hook_attrs(project) + path_with_namespace = project.path_with_namespace + + { + id: id, + message: safe_message, + timestamp: committed_date.xmlschema, + url: "#{Gitlab.config.gitlab.url}/#{path_with_namespace}/commit/#{id}", + author: { + name: author_name, + email: author_email + } + } + end + # Discover issues should be closed when this commit is pushed to a project's # default branch. def closes_issues(project) |