lib/grit/git-ruby/git_object.rb in grit-2.4.1 vs lib/grit/git-ruby/git_object.rb in grit-2.5.0
- old
+ new
@@ -47,10 +47,11 @@
end
# base class for all git objects (blob, tree, commit, tag)
class GitObject
attr_accessor :repository
+ attr_accessor :sha
def GitObject.from_raw(rawobject, repository = nil)
case rawobject.type
when :blob
return Blob.from_raw(rawobject, repository)
@@ -288,11 +289,12 @@
end
end
class Tag < GitObject
- attr_accessor :object, :type, :tag, :tagger, :message
+ attr_accessor :object, :tag, :tagger, :message, :object_type
+ attr_writer :type
def self.from_raw(rawobject, repository=nil)
headers, message = rawobject.content.split(/\n\n/, 2)
headers = headers.split(/\n/).map { |header| header.split(' ', 2) }
@@ -328,9 +330,10 @@
end
def initialize(object, type, tag, tagger, message, repository=nil)
@object = object
@type = type
+ @object_type = type
@tag = tag
@tagger = tagger
@repository = repository
@message = message
end