From 9d59d2965184964ab6662282ef5f9ceac2c58552 Mon Sep 17 00:00:00 2001 From: scott Chacon Date: Fri, 9 Nov 2007 13:11:22 -0800 Subject: added branches, more log stuff, better tests, changed the log api a bit added tests for Git::Lib, started Git::Diff development --- lib/git/log.rb | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'lib/git/log.rb') diff --git a/lib/git/log.rb b/lib/git/log.rb index d11a6fa..eb625f3 100644 --- a/lib/git/log.rb +++ b/lib/git/log.rb @@ -7,7 +7,8 @@ module Git @base = nil @commits = nil - @file = nil + @object = nil + @path = nil @count = nil @since = nil @between = nil @@ -20,9 +21,15 @@ module Git @count = count end - def file(file) + def object(objectish) dirty_log - @file = file + @object = objectish + return self + end + + def path(path) + dirty_log + @path = path return self end @@ -77,7 +84,9 @@ module Git # actually run the 'git log' command def run_log - @commits = @base.lib.log_commits(:count => @count, :file => @file, :since => @since, :between => @between) + log = @base.lib.log_commits(:count => @count, :object => @object, + :path_limiter => @path, :since => @since, :between => @between) + @commits = log.map { |l| Git::Object::Commit.new(@base, l) } end end -- cgit