From 476d943baabc9852f1653088a58bdb2912bbd95a Mon Sep 17 00:00:00 2001 From: Scott Chacon Date: Sat, 8 Mar 2008 18:33:34 -0800 Subject: added tree.depth and tree.full_tree --- lib/git/lib.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/git/lib.rb') diff --git a/lib/git/lib.rb b/lib/git/lib.rb index 4352640..8003336 100644 --- a/lib/git/lib.rb +++ b/lib/git/lib.rb @@ -181,6 +181,14 @@ module Git data end + + def full_tree(sha) + command_lines('ls-tree', ['-r', sha.to_s]) + end + + def tree_depth(sha) + full_tree(sha).size + end def branches_all head = File.read(File.join(@git_dir, 'HEAD')) -- cgit