From acd179d1a8fc0a806532c8887d72c5c84cdfbc6e Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Tue, 26 Feb 2013 18:32:35 +0600 Subject: [PATCH] #971 fix commit link --- app/models/activity_feed_observer.rb | 2 +- lib/modules/models/git.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/activity_feed_observer.rb b/app/models/activity_feed_observer.rb index 771e23305..d2ccc50f8 100644 --- a/app/models/activity_feed_observer.rb +++ b/app/models/activity_feed_observer.rb @@ -75,7 +75,7 @@ class ActivityFeedObserver < ActiveRecord::Observer change_type = record.change_type branch_name = record.refname.split('/').last if record.user # online update - last_commits, first_commiter = [[record.newrev, record.message]], record.user + last_commits, first_commiter = [[record.oldrev, record.message]], record.user else last_commits = record.project.repo.log(branch_name, nil).first(3) first_commiter = User.find_by_email(last_commits[0].author.email) unless last_commits.blank? diff --git a/lib/modules/models/git.rb b/lib/modules/models/git.rb index 6aa2c23da..eb477f06c 100644 --- a/lib/modules/models/git.rb +++ b/lib/modules/models/git.rb @@ -57,7 +57,7 @@ module Modules index.add(path, data) if sha1 = index.commit(message, :parents => [parent], :actor => actor, :last_tree => parent.tree.id, :head => head) - Project.process_hook(owner.uname, name, "refs/heads/#{sha1}", nil, head, 'commit', 'commit', options[:actor], message) + Project.process_hook(owner.uname, name, "refs/heads/#{sha1}", sha1, head, 'commit', 'commit', options[:actor], message) end sha1 end