From fde3263abc5c7866aa7dce7aef28eacaa33d7664 Mon Sep 17 00:00:00 2001 From: scott Chacon Date: Sat, 10 Nov 2007 12:43:33 -0800 Subject: few hours work - diff is done --- lib/git/object.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/git/object.rb') diff --git a/lib/git/object.rb b/lib/git/object.rb index f2d4114..f100597 100644 --- a/lib/git/object.rb +++ b/lib/git/object.rb @@ -2,7 +2,7 @@ module Git class Object class AbstractObject - attr_accessor :sha, :size, :type + attr_accessor :sha, :size, :type, :mode @base = nil @@ -26,7 +26,7 @@ module Git end def to_s - "#{@type.ljust(6)} #{@sha}" + @sha end def grep(string, path_limiter = nil, opts = {}) @@ -35,8 +35,12 @@ module Git @base.lib.grep(string, grep_options) end + def diff(objectish) + Git::Diff.new(@base, @sha, objectish) + end + def log(count = 30) - Git::Log.new(self, count).object(@sha) + Git::Log.new(@base, count).object(@sha) end end -- cgit