From 36546122feb52520ba005b8c0fd452d766dc06be Mon Sep 17 00:00:00 2001 From: scott Chacon Date: Thu, 15 Nov 2007 16:15:46 -0800 Subject: added tree? blob? commit? tag? predicates for git objects --- lib/git/object.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/git/object.rb b/lib/git/object.rb index 4372463..33c3e38 100644 --- a/lib/git/object.rb +++ b/lib/git/object.rb @@ -53,6 +53,22 @@ module Git @base.lib.archive(@sha, file, opts) end + def tree? + @type == 'tree' + end + + def blob? + @type == 'blob' + end + + def commit? + @type == 'commit' + end + + def tag? + @type == 'tag' + end + end -- cgit