Class | Git::Object |
In: |
lib/git/object.rb
|
Parent: | Object |
represents a git object
if we’re calling this, we don’t know what type it is yet so this is our little factory method
# File lib/git/object.rb, line 256 def new(base, objectish, type = nil, is_tag = false) if is_tag sha = base.lib.tag_sha(objectish) if sha == '' raise Git::GitTagNameDoesNotExist.new(objectish) end return Tag.new(base, sha, objectish) else if !type type = base.lib.object_type(objectish) end end klass = case type when /blob/: Blob when /commit/: Commit when /tree/: Tree end klass::new(base, objectish) end