summaryrefslogtreecommitdiffstats
path: root/lib/git/lib.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/git/lib.rb')
-rw-r--r--lib/git/lib.rb8
1 files changed, 8 insertions, 0 deletions
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'))