Gollum::Page#versions sets :follow to false by default, and skips pagination options.
This commit is contained in:
+4
-4
@@ -151,18 +151,18 @@ module Gollum
|
||||
# :page - The Integer page number (default: 1).
|
||||
# :per_page - The Integer max count of items to return.
|
||||
# :follow - Follow's a file across renames, but falls back
|
||||
# to a slower Grit native call. (default: true)
|
||||
# to a slower Grit native call. (default: false)
|
||||
#
|
||||
# Returns an Array of Grit::Commit.
|
||||
def versions(options = {})
|
||||
options[:follow] = true if !options.key?(:follow)
|
||||
options = log_pagination_options(options)
|
||||
if options[:follow]
|
||||
options[:pretty] = 'raw'
|
||||
options.delete :max_count
|
||||
options.delete :skip
|
||||
log = @wiki.repo.git.native "log", options, "master", "--", @path
|
||||
Grit::Commit.list_from_string(@wiki.repo, log)
|
||||
else
|
||||
@wiki.repo.log('master', @path, options)
|
||||
@wiki.repo.log('master', @path, log_pagination_options(options))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ context "Page" do
|
||||
test "page versions across renames" do
|
||||
page = @wiki.page 'My-Precious'
|
||||
assert_equal ['60f12f4254f58801b9ee7db7bca5fa8aeefaa56b', '94523d7ae48aeba575099dd12926420d8fd0425d'],
|
||||
page.versions.map { |v| v.id }
|
||||
page.versions(:follow => true).map { |v| v.id }
|
||||
end
|
||||
|
||||
test "page versions without renames" do
|
||||
|
||||
Reference in New Issue
Block a user