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