summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
authorKirill Zaitsev <kirik910@gmail.com>2014-09-15 11:10:35 +0400
committerKirill Zaitsev <kirik910@gmail.com>2014-10-02 12:58:02 +0400
commit1c9d2e39c1aef8e10ebff6e57c174c197a3a1c93 (patch)
tree15d71443e6cf169c2f50d1f4798634ca8cb318c0 /app/models/commit.rb
parente2073f286e1eceb961795af5ea88a39b440e49ac (diff)
downloadgitlab-ce-1c9d2e39c1aef8e10ebff6e57c174c197a3a1c93.tar.gz
Hook attributes
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index c8b2e0475ff..d18738a72dc 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