Method: Git::Base::Factory#object

Defined in:
lib/git/base/factory.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 factory 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



68
69
70
# File 'lib/git/base/factory.rb', line 68

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