summaryrefslogtreecommitdiffstats
path: root/lib/git
diff options
context:
space:
mode:
authorscott Chacon <schacon@agadorsparticus.corp.reactrix.com>2007-11-15 16:15:46 -0800
committerscott Chacon <schacon@agadorsparticus.corp.reactrix.com>2007-11-15 16:15:46 -0800
commit36546122feb52520ba005b8c0fd452d766dc06be (patch)
tree2b5b329a92235d3d5452cff59169581c4a4adcce /lib/git
parent877662762990b766d071ff272160e8a7bbe85441 (diff)
downloadthird_party-ruby-git-36546122feb52520ba005b8c0fd452d766dc06be.tar.gz
third_party-ruby-git-36546122feb52520ba005b8c0fd452d766dc06be.tar.xz
third_party-ruby-git-36546122feb52520ba005b8c0fd452d766dc06be.zip
added tree? blob? commit? tag? predicates for git objects
Diffstat (limited to 'lib/git')
-rw-r--r--lib/git/object.rb16
1 files changed, 16 insertions, 0 deletions
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