yield the created SHA1 in the after_commit callback

This commit is contained in:
rick
2011-01-19 05:51:16 -08:00
parent 2b1510af11
commit 8ddb781588
3 changed files with 30 additions and 6 deletions
+3 -2
View File
@@ -144,14 +144,15 @@ module Gollum
def commit
sha1 = index.commit(@options[:message], parents, actor)
@callbacks.each do |cb|
cb.call(self)
cb.call(self, sha1)
end
sha1
end
# Adds a callback to be fired after a commit.
#
# block - A block that expects this Committer instance as the argument.
# block - A block that expects this Committer instance and the created
# commit's SHA1 as the arguments.
#
# Returns nothing.
def after_commit(&block)