diff options
Diffstat (limited to 'lib/git/log.rb')
-rw-r--r-- | lib/git/log.rb | 17 |
1 files changed, 13 insertions, 4 deletions
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 |