# Max 20 commits from push DESC
def commits
- @commits ||= data[:commits].map { |commit| repository.commit(commit[:id]) }.reverse
+ @commits ||= data[:commits].reverse
end
def commits_count
end
end
- def repository
- project.repository
- end
-
- def parent_commit
- repository.commit(commit_from)
- rescue => ex
- nil
- end
-
- def last_commit
- repository.commit(commit_to)
- rescue => ex
- nil
- end
-
def push_with_commits?
- md_ref? && commits.any? && parent_commit && last_commit
- rescue Grit::NoSuchPathError
- false
+ md_ref? && commits.any? && commit_from && commit_to
end
def last_push_to_non_root?
@events.each do |event|
if event.proper?
- event = EventDecorator.decorate(event)
xml.entry do
- event_link = event.feed_url
- event_title = event.feed_title
- event_summary = event.feed_summary
+ event_link = event_feed_url(event)
+ event_title = event_feed_title(event)
+ event_summary = event_feed_summary(event)
xml.id "tag:#{request.host},#{event.created_at.strftime("%Y-%m-%d")}:#{event.id}"
xml.link :href => event_link
%li.commit
%p
- = link_to commit.short_id(8), project_commit_path(project, commit), class: "commit_short_id"
- %span= commit.author_name
+ = link_to commit[:id][0..8], project_commit_path(project, commit[:id]), class: "commit_short_id"
+ %span= commit[:author][:name]
–
- = image_tag gravatar_icon(commit.author_email), class: "avatar", width: 16
- = gfm escape_once(truncate(commit.title, length: 50)) rescue "--broken encoding"
+ = image_tag gravatar_icon(commit[:author][:email]), class: "avatar", width: 16
+ = gfm escape_once(truncate(commit[:message], length: 50)) rescue "--broken encoding"