summaryrefslogtreecommitdiffstats
path: root/lib/git/object.rb
diff options
context:
space:
mode:
authorscott Chacon <schacon@agadorsparticus.(none)>2007-11-10 12:43:33 -0800
committerscott Chacon <schacon@agadorsparticus.(none)>2007-11-10 12:43:33 -0800
commitfde3263abc5c7866aa7dce7aef28eacaa33d7664 (patch)
treec9911ac92e9770c7bfea3e79269f8e7dcf7f6982 /lib/git/object.rb
parent9d59d2965184964ab6662282ef5f9ceac2c58552 (diff)
downloadthird_party-ruby-git-fde3263abc5c7866aa7dce7aef28eacaa33d7664.tar.gz
third_party-ruby-git-fde3263abc5c7866aa7dce7aef28eacaa33d7664.tar.xz
third_party-ruby-git-fde3263abc5c7866aa7dce7aef28eacaa33d7664.zip
few hours work - diff is done
Diffstat (limited to 'lib/git/object.rb')
-rw-r--r--lib/git/object.rb10
1 files changed, 7 insertions, 3 deletions
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