Class Git::Object::Commit
In: lib/git/object.rb
Parent: AbstractObject

Methods

author   author_date   committer   committer_date   date   diff_parent   gtree   message   name   new   parent   parents   set_commit  

Public Class methods

[Source]

# File lib/git/object.rb, line 154
      def initialize(base, sha, init = nil)
        super(base, sha)
        if init
          set_commit(init)
        end
      end

Public Instance methods

git author

[Source]

# File lib/git/object.rb, line 186
      def author     
        check_commit
        @author
      end

[Source]

# File lib/git/object.rb, line 191
      def author_date
        author.date
      end

git author

[Source]

# File lib/git/object.rb, line 196
      def committer
        check_commit
        @committer
      end

[Source]

# File lib/git/object.rb, line 201
      def committer_date 
        committer.date
      end
date()

Alias for committer_date

[Source]

# File lib/git/object.rb, line 206
      def diff_parent
        diff(parent)
      end

[Source]

# File lib/git/object.rb, line 170
      def gtree
        check_commit
        Tree.new(@base, @tree)
      end

[Source]

# File lib/git/object.rb, line 161
      def message
        check_commit
        @message
      end

[Source]

# File lib/git/object.rb, line 166
      def name
        @base.lib.namerev(sha)
      end

[Source]

# File lib/git/object.rb, line 175
      def parent
        parents.first
      end

array of all parent commits

[Source]

# File lib/git/object.rb, line 180
      def parents
        check_commit
        @parents        
      end

[Source]

# File lib/git/object.rb, line 210
      def set_commit(data)
        @committer = Git::Author.new(data['committer'])
        @author = Git::Author.new(data['author'])
        @tree = Tree.new(@base, data['tree'])
        @parents = data['parent'].map{ |sha| Commit.new(@base, sha) }
        @message = data['message'].chomp
      end

[Validate]