Class | Git::Object |
In: |
lib/git/object.rb
|
Parent: | 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 87 def new(base, objectish, 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 sha = base.lib.revparse(objectish) type = base.lib.object_type(sha) end klass = case type when /blob/: Blob when /commit/: Commit when /tree/: Tree end klass::new(base, sha) end