Method: Git::Base#object

Defined in:
lib/git/base.rb

#object(objectish) ⇒ Git::Object

returns a Git::Object of the appropriate type you can also call @git.gtree('tree'), but that's just for readability. If you call @git.gtree('HEAD') it will still return a Git::Object::Commit object.

object calls a method that will run a rev-parse on the objectish and determine the type of the object and return an appropriate object for that type

Returns:

  • (Git::Object)

    an instance of the appropriate type of Git::Object

[View source]

757
758
759
# File 'lib/git/base.rb', line 757

def object(objectish)
  Git::Object.new(self, objectish)
end