Skip to content

Commit

Permalink
Fill out post-receive url payload
Browse files Browse the repository at this point in the history
  • Loading branch information
xdissent committed May 21, 2012
1 parent 20c4641 commit 7393953
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions app/controllers/gitolite_hooks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,13 @@ def post_receive_payloads(refs, project=nil)
revision = project.repository.find_changeset_by_name(rev.strip)
commit = {
:id => revision.revision,
:url => "",
:author => revision.author,
:message => "",
:timestamp => "",
:url => url_for_revision(revision),
:author => {
:name => revision.committer.gsub(/^([^<]+)\s+.*$/, '\1'),
:email => revision.committer.gsub(/^.*<([^>]+)>.*$/, '\1')
},
:message => revision.comments,
:timestamp => revision.committed_on,
:added => [],
:modified => [],
:removed => []
Expand All @@ -68,16 +71,17 @@ def post_receive_payloads(refs, project=nil)
:ref => refname,
:commits => commits,
:repository => {
:description => "",
:fork => "",
:homepage => "",
:name => "",
:open_issues => "",
:description => project.description,
:fork => false,
:forks => 0,
:homepage => project.homepage,
:name => project.identifier,
:open_issues => project.issues.open.length,
:owner => {
:email => "",
:name => ""
},
:private => true,
:private => !project.is_public,
:url => "",
:watchers => 0
}
Expand Down Expand Up @@ -122,7 +126,8 @@ def post_receive
} if @project.repository_mirrors.any?

payloads = post_receive_payloads(params[:refs])
GitHosting.logger.info "Payloads - #{payloads.to_json}"

# Post to each post-receive URL here

# Notify CIA
#Thread.abort_on_exception = true
Expand Down

0 comments on commit 7393953

Please sign in to comment.