summaryrefslogtreecommitdiffstats
path: root/lib/git/log.rb
diff options
context:
space:
mode:
authorscott Chacon <schacon@agadorsparticus.corp.reactrix.com>2007-11-09 13:11:22 -0800
committerscott Chacon <schacon@agadorsparticus.corp.reactrix.com>2007-11-09 13:11:22 -0800
commit9d59d2965184964ab6662282ef5f9ceac2c58552 (patch)
treef8dd8bf4004eb9403f9ffe2b5c5c708ef877895a /lib/git/log.rb
parentab20a674e50268b6c541949c746d77b16a26d15c (diff)
downloadthird_party-ruby-git-9d59d2965184964ab6662282ef5f9ceac2c58552.tar.gz
third_party-ruby-git-9d59d2965184964ab6662282ef5f9ceac2c58552.tar.xz
third_party-ruby-git-9d59d2965184964ab6662282ef5f9ceac2c58552.zip
added branches, more log stuff, better tests, changed the log api a bit
added tests for Git::Lib, started Git::Diff development
Diffstat (limited to 'lib/git/log.rb')
-rw-r--r--lib/git/log.rb17
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