class Git::Object::Commit
Public Class Methods
Source
# File lib/git/object.rb, line 162 def initialize(base, sha, init = nil) super(base, sha) @tree = nil @parents = nil @author = nil @committer = nil @message = nil if init set_commit(init) end end
Calls superclass method
Git::Object::AbstractObject::new
Public Instance Methods
Source
# File lib/git/object.rb, line 209 def committer check_commit @committer end
git author
Source
# File lib/git/object.rb, line 214 def committer_date committer.date end
Also aliased as: date
Source
# File lib/git/object.rb, line 183 def gtree check_commit Tree.new(@base, @tree) end
Source
# File lib/git/object.rb, line 193 def parents check_commit @parents end
array of all parent commits
Source
# File lib/git/object.rb, line 223 def set_commit(data) @sha ||= data['sha'] @committer = Git::Author.new(data['committer']) @author = Git::Author.new(data['author']) @tree = Git::Object::Tree.new(@base, data['tree']) @parents = data['parent'].map{ |sha| Git::Object::Commit.new(@base, sha) } @message = data['message'].chomp end
Private Instance Methods
Source
# File lib/git/object.rb, line 239 def check_commit return if @tree data = @base.lib.cat_file_commit(@objectish) set_commit(data) end
see if this object has been initialized and do so if not