diff options
author | Keith Pitt <me@keithpitt.com> | 2014-10-08 16:33:53 +0800 |
---|---|---|
committer | Keith Pitt <me@keithpitt.com> | 2014-10-08 16:33:53 +0800 |
commit | 4c7da578f200f0bc721cc2cae27eb2b25f96e8dd (patch) | |
tree | 565b5b7746bc2cff8e46883b4d1836dfaa0246ef /app/models/commit.rb | |
parent | 76594d474ca6d04c2e608e7b3df1229729288f14 (diff) | |
parent | 928178deb9d582d7537a57983ff9e695f07dab1f (diff) | |
download | gitlab-ce-4c7da578f200f0bc721cc2cae27eb2b25f96e8dd.tar.gz |
Merge branch 'master' into buildbox-service
Conflicts:
app/models/project.rb
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r-- | app/models/commit.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index c8b2e0475ff..a1343b65c72 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -88,9 +88,24 @@ 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 + def closes_issues(project) Gitlab::ClosingIssueExtractor.closed_by_message_in_project(safe_message, project) end |